01: /**
02: * Miroslav Popov, Sep 20, 2005
03: * miroslav.popov@gmail.com
04: */package org.enhydra.jawe.components.graph.actions;
05:
06: import org.enhydra.jawe.JaWEConstants;
07: import org.enhydra.jawe.JaWEManager;
08: import org.enhydra.jawe.components.graph.GraphController;
09: import org.enhydra.shark.xpdl.XMLUtil;
10:
11: /**
12: * @author Miroslav Popov
13: *
14: */
15: public class SetActivityMode extends SetToolboxMode {
16:
17: public SetActivityMode(GraphController jawecomponent, String subType) {
18: super (jawecomponent, JaWEConstants.ACTIVITY_TYPE, subType);
19: }
20:
21: public void enableDisableAction() {
22: GraphController gc = (GraphController) jawecomponent;
23:
24: if (gc.getSelectedGraph() != null
25: && XMLUtil.getPackage(gc.getSelectedGraph()
26: .getXPDLObject()) == JaWEManager.getInstance()
27: .getJaWEController().getMainPackage()
28: && gc.getSelectedGraph().getRoots().length != 0)
29: setEnabled(true);
30: else
31: setEnabled(false);
32: }
33:
34: }
|