Mercurial > projects > dwt-addons
comparison dwtx/jface/viewers/CheckStateChangedEvent.d @ 10:b6c35faf97c8
Viewers
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 31 Mar 2008 00:47:19 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9:6c14e54dfc11 | 10:b6c35faf97c8 |
---|---|
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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.viewers.CheckStateChangedEvent; | |
14 | |
15 import dwtx.jface.viewers.ICheckStateListener; | |
16 import dwtx.jface.viewers.ICheckable; | |
17 | |
18 import dwt.dwthelper.utils; | |
19 | |
20 /** | |
21 * Event object describing a change to the checked state | |
22 * of a viewer element. | |
23 * | |
24 * @see ICheckStateListener | |
25 */ | |
26 public class CheckStateChangedEvent : EventObject { | |
27 | |
28 /** | |
29 * Generated serial version UID for this class. | |
30 * @since 3.1 | |
31 */ | |
32 private static const long serialVersionUID = 3256443603340244789L; | |
33 | |
34 /** | |
35 * The viewer element. | |
36 */ | |
37 private Object element; | |
38 | |
39 /** | |
40 * The checked state. | |
41 */ | |
42 private bool state; | |
43 | |
44 /** | |
45 * Creates a new event for the given source, element, and checked state. | |
46 * | |
47 * @param source the source | |
48 * @param element the element | |
49 * @param state the checked state | |
50 */ | |
51 public this(ICheckable source, Object element, | |
52 bool state) { | |
53 super(cast(Object)source); | |
54 this.element = element; | |
55 this.state = state; | |
56 } | |
57 | |
58 /** | |
59 * Returns the checkable that is the source of this event. | |
60 * | |
61 * @return the originating checkable | |
62 */ | |
63 public ICheckable getCheckable() { | |
64 return cast(ICheckable) source; | |
65 } | |
66 | |
67 /** | |
68 * Returns the checked state of the element. | |
69 * | |
70 * @return the checked state | |
71 */ | |
72 public bool getChecked() { | |
73 return state; | |
74 } | |
75 | |
76 /** | |
77 * Returns the element whose check state changed. | |
78 * | |
79 * @return the element | |
80 */ | |
81 public Object getElement() { | |
82 return element; | |
83 } | |
84 } |