01: package net.refractions.udig.project.ui.tool;
02:
03: import net.refractions.udig.project.UDIGEvent;
04:
05: /**
06: *
07: * Event of tool lifecycle changing, such as:
08: * <p>
09: * <ul>
10: * <li>setActive(boolean) is called</li>
11: * <li>setEnabled(boolean) is called</li>
12: * <li>setContext(IToolContext) - the new context is set</li>
13: * </ul>
14: *
15: *
16: * @author Vitalus
17: * @since UDIG 1.1
18: *
19: */
20: public class ToolLifecycleEvent extends UDIGEvent {
21:
22: public static enum Type {
23:
24: ACTIVE,
25:
26: ENABLE,
27:
28: TOOL_CONTEXT
29:
30: }
31:
32: private Type type;
33:
34: /**
35: *
36: * @param source2
37: * @param type
38: * @param newValue2
39: * @param oldValue2
40: */
41: public ToolLifecycleEvent(Object source2, Type type,
42: Object newValue2, Object oldValue2) {
43: super (source2, newValue2, oldValue2);
44: this .type = type;
45: }
46:
47: /**
48: *
49: * @return
50: */
51: public ToolLifecycleEvent.Type getType() {
52: return type;
53: }
54:
55: @Override
56: public Object getSource() {
57: return source;
58: }
59:
60: }
|