KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > actions > CloseWorkspace


1 package com.opensymphony.workflow.designer.actions;
2
3 import java.awt.event.ActionEvent JavaDoc;
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 /**
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 WorkspaceListener
16 {
17   public CloseWorkspace()
18   {
19     setEnabled(false);
20   }
21
22   public void actionPerformed(ActionEvent JavaDoc 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