01: package com.opensymphony.workflow.designer.event;
02:
03: import java.util.EventObject;
04:
05: import com.opensymphony.workflow.loader.WorkflowFactory;
06:
07: /**
08: * @author Hani Suleiman (hani@formicary.net)
09: * Date: May 20, 2003
10: * Time: 11:52:02 PM
11: */
12: public class WorkspaceEvent extends EventObject {
13: public static final int WORKSPACE_OPENED = 1;
14: public static final int WORKSPACE_CLOSED = 2;
15: private int id;
16: private WorkflowFactory workspace;
17: private boolean consumed;
18:
19: public WorkspaceEvent(Object source) {
20: super (source);
21: }
22:
23: public WorkspaceEvent(Object source, WorkflowFactory workspace,
24: int id) {
25: super (source);
26: this .id = id;
27: this .workspace = workspace;
28: }
29:
30: public int getId() {
31: return id;
32: }
33:
34: public WorkflowFactory getWorkspace() {
35: return workspace;
36: }
37:
38: public boolean isConsumed() {
39: return consumed;
40: }
41:
42: public void consume() {
43: consumed = true;
44: }
45:
46: public String toString() {
47: StringBuffer sb = new StringBuffer(getClass().getName());
48: sb.append('[');
49: sb.append("id=");
50: sb.append(id == WORKSPACE_OPENED ? "WORKSPACE_OPENED "
51: : "WORKSPACE_CLOSED ");
52: sb.append("source=").append(source);
53: sb.append(']');
54: return sb.toString();
55: }
56: }
|