KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > terracotta > dso > actions > BootJarTypeAction


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package org.terracotta.dso.actions;
5
6 import org.eclipse.jdt.core.IType;
7 import org.terracotta.dso.ConfigurationHelper;
8 import org.terracotta.dso.TcPlugin;
9
10 /**
11  * This is currently not used.
12  */

13
14 /**
15  * Marks the currently selected IType as a BootJar class.
16  *
17  * @see org.eclipse.jdt.core.IType
18  * @see org.terracotta.dso.ConfigurationHelper.isBootJarClass
19  * @see org.terracotta.dso.ConfigurationHelper.ensureBootJarClass
20  * @see org.terracotta.dso.ConfigurationHelper.ensureNotBootJarClass
21  */

22
23 public class BootJarTypeAction extends BaseAction {
24   private IType m_type;
25   
26   public BootJarTypeAction() {
27     super("Boot Jar", AS_CHECK_BOX);
28   }
29   
30   public void setType(IType type) {
31     setJavaElement(m_type = type);
32     
33     boolean isBootClass = TcPlugin.getDefault().isBootClass(type);
34     setEnabled(!isBootClass);
35     setChecked(isBootClass || getConfigHelper().isBootJarClass(type));
36   }
37   
38   public void performAction() {
39     ConfigurationHelper helper = getConfigHelper();
40     
41     if(isChecked()) {
42       helper.ensureBootJarClass(m_type);
43     }
44     else {
45       helper.ensureNotBootJarClass(m_type);
46     }
47
48     inspectCompilationUnit();
49   }
50 }
51
Popular Tags