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.JaWEManager;
08: import org.enhydra.jawe.base.controller.JaWEController;
09:
10: /**
11: * Class that realizes <B>close</B> action.
12: * @author Sasa Bojanic
13: */
14: public class Close extends ActionBase {
15:
16: public Close(JaWEComponent jawecomponent) {
17: super (jawecomponent);
18: }
19:
20: public void enableDisableAction() {
21: JaWEController jc = (JaWEController) jawecomponent;
22: if (jc.getMainPackage() != null)
23: setEnabled(true);
24: else
25: setEnabled(false);
26: }
27:
28: public void actionPerformed(ActionEvent e) {
29: JaWEController jc = JaWEManager.getInstance()
30: .getJaWEController();
31: jc.tryToClosePackage(jc.getMainPackageId(), false);
32: }
33:
34: }
|