01: package org.enhydra.jawe.base.controller.actions;
02:
03: import java.awt.event.ActionEvent;
04:
05: import org.enhydra.jawe.ActionBase;
06: import org.enhydra.jawe.JaWEComponent;
07: import org.enhydra.jawe.base.controller.JaWEController;
08: import org.enhydra.shark.xpdl.elements.Package;
09:
10: /**
11: * Adds external package into the system.
12: * @author Sasa Bojanic
13: */
14: public class PackageAddExternalPackage extends ActionBase {
15:
16: public PackageAddExternalPackage(JaWEComponent jawecomponent) {
17: super (jawecomponent);
18: }
19:
20: public void enableDisableAction() {
21: JaWEController jc = (JaWEController) jawecomponent;
22: if (jc.getMainPackage() != null
23: && jc.getPackageFilename(jc.getMainPackageId()) != null)
24: setEnabled(true);
25: else
26: setEnabled(false);
27: }
28:
29: public void actionPerformed(ActionEvent e) {
30: JaWEController jc = (JaWEController) jawecomponent;
31: Package mainPkg = jc.getMainPackage();
32: if (mainPkg == null)
33: return;
34: jc.addExternalPackage();
35: }
36:
37: }
|