01: package com.opensymphony.workflow.designer.actions;
02:
03: import java.awt.event.ActionEvent;
04: import javax.swing.AbstractAction;
05:
06: import com.opensymphony.workflow.designer.event.WorkspaceListener;
07: import com.opensymphony.workflow.designer.event.WorkspaceEvent;
08: import com.opensymphony.workflow.designer.WorkflowDesigner;
09:
10: public class ValidateSaveWorkflow extends AbstractAction implements
11: WorkspaceListener {
12: public ValidateSaveWorkflow() {
13: setEnabled(false);
14: }
15:
16: public void actionPerformed(ActionEvent arg0) {
17: WorkflowDesigner.INSTANCE.validateSaveCurrentWorkflow();
18: }
19:
20: public void workspaceChanged(WorkspaceEvent event) {
21: if (event.getId() == WorkspaceEvent.WORKSPACE_OPENED) {
22: setEnabled(true);
23: } else {
24: setEnabled(false);
25: }
26: }
27:
28: }
|