KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > viewers > CheckStateChangedEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.viewers;
12
13 import java.util.EventObject JavaDoc;
14
15 /**
16  * Event object describing a change to the checked state
17  * of a viewer element.
18  *
19  * @see ICheckStateListener
20  */

21 public class CheckStateChangedEvent extends EventObject JavaDoc {
22
23     /**
24      * Generated serial version UID for this class.
25      * @since 3.1
26      */

27     private static final long serialVersionUID = 3256443603340244789L;
28
29     /**
30      * The viewer element.
31      */

32     private Object JavaDoc element;
33
34     /**
35      * The checked state.
36      */

37     private boolean state;
38
39     /**
40      * Creates a new event for the given source, element, and checked state.
41      *
42      * @param source the source
43      * @param element the element
44      * @param state the checked state
45      */

46     public CheckStateChangedEvent(ICheckable source, Object JavaDoc element,
47             boolean state) {
48         super(source);
49         this.element = element;
50         this.state = state;
51     }
52
53     /**
54      * Returns the checkable that is the source of this event.
55      *
56      * @return the originating checkable
57      */

58     public ICheckable getCheckable() {
59         return (ICheckable) source;
60     }
61
62     /**
63      * Returns the checked state of the element.
64      *
65      * @return the checked state
66      */

67     public boolean getChecked() {
68         return state;
69     }
70
71     /**
72      * Returns the element whose check state changed.
73      *
74      * @return the element
75      */

76     public Object JavaDoc getElement() {
77         return element;
78     }
79 }
80
Popular Tags