01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: * Tom Schindl <tom.schindl@bestsolution.at> - port to MyGWT (issue 39)
11: *******************************************************************************/package net.mygwt.ui.client.viewer;
12:
13: import java.util.EventObject;
14:
15: /**
16: * Event object describing a change to the checked state of a viewer element.
17: *
18: * @see ICheckStateListener
19: */
20: public class CheckStateChangedEvent extends EventObject {
21:
22: /**
23: * Generated serial version UID for this class.
24: */
25: private static final long serialVersionUID = 3256443603340244789L;
26:
27: /**
28: * The viewer element.
29: */
30: private Object element;
31:
32: /**
33: * The checked state.
34: */
35: private boolean state;
36:
37: /**
38: * Creates a new event for the given source, element, and checked state.
39: *
40: * @param source the source
41: * @param element the element
42: * @param state the checked state
43: */
44: public CheckStateChangedEvent(ICheckable source, Object element,
45: boolean state) {
46: super (source);
47: this .element = element;
48: this .state = state;
49: }
50:
51: /**
52: * Returns the checkable that is the source of this event.
53: *
54: * @return the originating checkable
55: */
56: public ICheckable getCheckable() {
57: return (ICheckable) getSource();
58: }
59:
60: /**
61: * Returns the checked state of the element.
62: *
63: * @return the checked state
64: */
65: public boolean getChecked() {
66: return state;
67: }
68:
69: /**
70: * Returns the element whose check state changed.
71: *
72: * @return the element
73: */
74: public Object getElement() {
75: return element;
76: }
77: }
|