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: import org.enhydra.jawe.base.editor.XPDLElementEditor;
10:
11: /**
12: * Class that realizes <B>Namespaces</B> action.
13: * @author Sasa Bojanic
14: */
15: public class PackageNamespaces extends ActionBase {
16:
17: public PackageNamespaces(JaWEComponent jawecomponent) {
18: super (jawecomponent);
19: }
20:
21: public void enableDisableAction() {
22: if (getPackage() != null)
23: setEnabled(true);
24: else
25: setEnabled(false);
26: }
27:
28: public void actionPerformed(ActionEvent e) {
29: if (getPackage() == null)
30: return;
31: JaWEController jc = (JaWEController) jawecomponent;
32: jc.getSelectionManager().setSelection(
33: getPackage().getNamespaces(), false);
34: XPDLElementEditor ed = JaWEManager.getInstance()
35: .getXPDLElementEditor();
36: ed.editXPDLElement(getPackage().getNamespaces());
37: }
38:
39: }
|