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: *******************************************************************************/package org.eclipse.jface.viewers;
11:
12: import java.util.EventObject;
13:
14: /**
15: * Event object describing a change to the checked state
16: * 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: * @since 3.1
25: */
26: private static final long serialVersionUID = 3256443603340244789L;
27:
28: /**
29: * The viewer element.
30: */
31: private Object element;
32:
33: /**
34: * The checked state.
35: */
36: private boolean state;
37:
38: /**
39: * Creates a new event for the given source, element, and checked state.
40: *
41: * @param source the source
42: * @param element the element
43: * @param state the checked state
44: */
45: public CheckStateChangedEvent(ICheckable source, Object element,
46: boolean state) {
47: super (source);
48: this .element = element;
49: this .state = state;
50: }
51:
52: /**
53: * Returns the checkable that is the source of this event.
54: *
55: * @return the originating checkable
56: */
57: public ICheckable getCheckable() {
58: return (ICheckable) source;
59: }
60:
61: /**
62: * Returns the checked state of the element.
63: *
64: * @return the checked state
65: */
66: public boolean getChecked() {
67: return state;
68: }
69:
70: /**
71: * Returns the element whose check state changed.
72: *
73: * @return the element
74: */
75: public Object getElement() {
76: return element;
77: }
78: }
|