01: package com.opensymphony.workflow.designer.actions;
02:
03: import java.awt.event.ActionEvent;
04: import javax.swing.*;
05:
06: import com.opensymphony.workflow.designer.WorkflowDesigner;
07: import com.opensymphony.workflow.designer.event.WorkspaceListener;
08: import com.opensymphony.workflow.designer.event.WorkspaceEvent;
09:
10: /**
11: * @author Hani Suleiman (hani@formicary.net)
12: * Date: May 21, 2003
13: * Time: 12:21:03 AM
14: */
15: public class CloseWorkspace extends AbstractAction implements
16: WorkspaceListener {
17: public CloseWorkspace() {
18: setEnabled(false);
19: }
20:
21: public void actionPerformed(ActionEvent e) {
22: WorkflowDesigner.INSTANCE.closeWorkspace();
23: }
24:
25: public void workspaceChanged(WorkspaceEvent event) {
26: if (event.getId() == WorkspaceEvent.WORKSPACE_OPENED) {
27: setEnabled(true);
28: } else {
29: setEnabled(false);
30: }
31: }
32: }
|