KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > event > WorkspaceEvent


1 package com.opensymphony.workflow.designer.event;
2
3 import java.util.EventObject JavaDoc;
4
5 import com.opensymphony.workflow.loader.Workspace;
6
7 /**
8  * @author Hani Suleiman (hani@formicary.net)
9  * Date: May 20, 2003
10  * Time: 11:52:02 PM
11  */

12 public class WorkspaceEvent extends EventObject JavaDoc
13 {
14   public static final int WORKSPACE_OPENED = 1;
15   public static final int WORKSPACE_CLOSED = 2;
16   private int id;
17   private Workspace workspace;
18   private boolean consumed;
19
20   public WorkspaceEvent(Object JavaDoc source)
21   {
22     super(source);
23   }
24
25   public WorkspaceEvent(Object JavaDoc source, Workspace workspace, int id)
26   {
27     super(source);
28     this.id = id;
29     this.workspace = workspace;
30   }
31
32   public int getId()
33   {
34     return id;
35   }
36
37   public Workspace getWorkspace()
38   {
39     return workspace;
40   }
41
42   public boolean isConsumed()
43   {
44     return consumed;
45   }
46
47   public void consume()
48   {
49     consumed = true;
50   }
51
52   public String JavaDoc toString()
53   {
54     StringBuffer JavaDoc sb = new StringBuffer JavaDoc(getClass().getName());
55     sb.append("[");
56     sb.append("id=");
57     sb.append(id==WORKSPACE_OPENED ? "WORKSPACE_OPENED " : "WORKSPACE_CLOSED ");
58     sb.append("source=").append(source);
59     sb.append("]");
60     return sb.toString();
61   }
62 }
63
Popular Tags