01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.actions;
05:
06: import org.eclipse.jdt.core.IType;
07: import org.terracotta.dso.ConfigurationHelper;
08: import org.terracotta.dso.TcPlugin;
09:
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
36: || getConfigHelper().isBootJarClass(type));
37: }
38:
39: public void performAction() {
40: ConfigurationHelper helper = getConfigHelper();
41:
42: if (isChecked()) {
43: helper.ensureBootJarClass(m_type);
44: } else {
45: helper.ensureNotBootJarClass(m_type);
46: }
47:
48: inspectCompilationUnit();
49: }
50: }
|