1 package com.opensymphony.workflow.designer.actions; 2 3 import java.awt.event.ActionEvent ; 4 import javax.swing.*; 5 6 import com.opensymphony.workflow.designer.WorkflowDesigner; 7 import com.opensymphony.workflow.designer.event.WorkspaceListener; 8 import com.opensymphony.workflow.designer.event.WorkspaceEvent; 9 10 15 public class CloseWorkspace extends AbstractAction implements WorkspaceListener 16 { 17 public CloseWorkspace() 18 { 19 setEnabled(false); 20 } 21 22 public void actionPerformed(ActionEvent e) 23 { 24 WorkflowDesigner.INSTANCE.closeWorkspace(); 25 } 26 27 public void workspaceChanged(WorkspaceEvent event) 28 { 29 if(event.getId()==WorkspaceEvent.WORKSPACE_OPENED) 30 { 31 setEnabled(true); 32 } 33 else 34 { 35 setEnabled(false); 36 } 37 } 38 } 39 | Popular Tags |