01: /**
02: * Miroslav Popov, Sep 1, 2005
03: */package org.enhydra.jawe.base.controller.actions.defaultactions;
04:
05: import java.awt.event.ActionEvent;
06: import java.util.Collection;
07:
08: import org.enhydra.jawe.ActionBase;
09: import org.enhydra.jawe.JaWEComponent;
10: import org.enhydra.jawe.JaWEManager;
11: import org.enhydra.jawe.base.controller.JaWEController;
12: import org.enhydra.jawe.base.editor.XPDLElementEditor;
13: import org.enhydra.shark.xpdl.XMLElement;
14:
15: /**
16: * @author Miroslav Popov
17: *
18: */
19: public class EditProperties extends ActionBase {
20:
21: public EditProperties(JaWEComponent jawecomponent) {
22: super (jawecomponent);
23: }
24:
25: public void enableDisableAction() {
26: JaWEController jc = (JaWEController) jawecomponent;
27: setEnabled(jc.getSelectionManager().canEditProperties()
28: && !JaWEManager.getInstance().getXPDLElementEditor()
29: .isVisible());
30: }
31:
32: public void actionPerformed(ActionEvent e) {
33: JaWEController jc = (JaWEController) jawecomponent;
34:
35: Collection c = jc.getSelectionManager().getSelectedElements();
36: if (c.size() != 1)
37: return;
38:
39: setEnabled(false);
40:
41: XPDLElementEditor ed = JaWEManager.getInstance()
42: .getXPDLElementEditor();
43: ed.editXPDLElement((XMLElement) c.iterator().next());
44:
45: }
46: }
|