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.BarFactory;
07: import org.enhydra.jawe.JaWEComponent;
08: import org.enhydra.jawe.JaWEManager;
09: import org.enhydra.jawe.base.controller.JaWEController;
10:
11: /**
12: * Class that realizes <B>open</B> action.
13: * @author Sasa Bojanic
14: */
15: public class Open extends ActionBase {
16:
17: public Open(JaWEComponent jawecomponent) {
18: super (jawecomponent);
19: }
20:
21: public void enableDisableAction() {
22: }
23:
24: public void actionPerformed(ActionEvent e) {
25: JaWEController jc = JaWEManager.getInstance()
26: .getJaWEController();
27: String fn = jc.getPackageFilename(jc.getMainPackageId());
28: if (jc.tryToClosePackage(jc.getMainPackageId(), false)) {
29: String name = jc.getJaWEFrame().openDialog(
30: jc.getSettings().getLanguageDependentString(
31: "Open" + BarFactory.LABEL_POSTFIX), fn);
32: if (name == null)
33: return;
34: jc.openPackageFromFile(name);
35: }
36:
37: }
38:
39: }
|