comparison dwtx/draw2d/ChangeEvent.d @ 98:95307ad235d9

Added Draw2d code, still work in progress
author Frank Benoit <benoit@tionex.de>
date Sun, 03 Aug 2008 00:52:14 +0200
parents
children
comparison
equal deleted inserted replaced
96:b492ba44e44d 98:95307ad235d9
1 /*******************************************************************************
2 * Copyright (c) 2000, 2005 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.draw2d.ChangeEvent;
14
15 import dwt.dwthelper.utils;
16
17 /**
18 * An event for property changes. Includes the source of the event as well as the name of
19 * the property that has changed.
20 */
21 public class ChangeEvent
22 : /+java.util.+/EventObject
23 {
24
25 private String property;
26
27 /**
28 * Constructs a new ChangeEvent with the given object as the source of the event.
29 * @param source The source of the event
30 */
31 public this(Object source) {
32 super(source);
33 }
34
35 /**
36 * Constructs a new ChangeEvent with the given source object and property name.
37 * @param source The source of the event
38 * @param property The property name
39 */
40 public this(Object source, String property) {
41 super(source);
42 setPropertyName(property);
43 }
44
45 /**
46 * Returns the name of the property that has changed.
47 * @return String the name of the property that has changed
48 */
49 public String getPropertyName() {
50 return property;
51 }
52
53 /**
54 * Sets the name of the property that has changed.
55 * @param string The property name
56 */
57 protected void setPropertyName(String string) {
58 property = string;
59 }
60
61 }