01: package org.enhydra.jawe;
02:
03: import javax.swing.AbstractAction;
04: import javax.swing.Action;
05:
06: import org.enhydra.shark.xpdl.elements.ActivitySet;
07: import org.enhydra.shark.xpdl.elements.Package;
08: import org.enhydra.shark.xpdl.elements.WorkflowProcess;
09:
10: /**
11: * The base class for JaWE actions.
12: */
13: public abstract class ActionBase extends AbstractAction {
14:
15: protected JaWEComponent jawecomponent;
16:
17: /**
18: * The Abstract action uses unqualified class name as action name.
19: * @param jawecomponent
20: *
21: */
22: public ActionBase(JaWEComponent jawecomponent) {
23: this .jawecomponent = jawecomponent;
24: putValue(Action.NAME, Utils.getUnqualifiedClassName(getClass()));
25: }
26:
27: /**
28: * Constructor which accepts the action name.
29: * @param jawecomponent
30: * @param name Name of this action
31: */
32:
33: public ActionBase(JaWEComponent jawecomponent, String name) {
34: super (name);
35: this .jawecomponent = jawecomponent;
36: }
37:
38: public abstract void enableDisableAction();
39:
40: public Package getPackage() {
41: return JaWEManager.getInstance().getJaWEController()
42: .getSelectionManager().getWorkingPKG();
43: }
44:
45: public WorkflowProcess getWorkflowProcess() {
46: return JaWEManager.getInstance().getJaWEController()
47: .getSelectionManager().getWorkingProcess();
48: }
49:
50: public ActivitySet getActivitySet() {
51: return JaWEManager.getInstance().getJaWEController()
52: .getSelectionManager().getWorkingActivitySet();
53: }
54: }
|