01: package org.enhydra.jawe.base.controller.actions;
02:
03: import java.awt.event.ActionEvent;
04:
05: import org.enhydra.jawe.JaWEComponent;
06: import org.enhydra.jawe.JaWEManager;
07: import org.enhydra.jawe.NewActionBase;
08: import org.enhydra.jawe.base.controller.JaWEController;
09: import org.enhydra.jawe.base.controller.JaWETypeChoiceButton;
10: import org.enhydra.shark.xpdl.elements.Package;
11:
12: /**
13: * Class that realizes <B>new</B> action.
14: *
15: * @author Sasa Bojanic
16: */
17: public class NewPackage extends NewActionBase {
18:
19: public NewPackage(JaWEComponent jawecomponent) {
20: super (jawecomponent, Package.class);
21: }
22:
23: public void enableDisableAction() {
24: }
25:
26: public void actionPerformed(ActionEvent e) {
27: if (!(e.getSource() instanceof JaWETypeChoiceButton)) {
28: JaWEController jc = JaWEManager.getInstance()
29: .getJaWEController();
30: if (jc.tryToClosePackage(jc.getMainPackageId(), false)) {
31: jc.newPackage(jc.getJaWETypes().getDefaultType(
32: Package.class));
33: }
34: }
35: }
36:
37: }
|