Project

General

Profile

Download (1.66 KB) Statistics
| Branch: | Tag: | Revision:
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 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.draw2d;
12

    
13
/**
14
 * An event for property changes. Includes the source of the event as well as
15
 * the name of the property that has changed.
16
 */
17
public class ChangeEvent extends java.util.EventObject {
18

    
19
	private String property;
20

    
21
	/**
22
	 * Constructs a new ChangeEvent with the given object as the source of the
23
	 * event.
24
	 * 
25
	 * @param source
26
	 *            The source of the event
27
	 */
28
	public ChangeEvent(Object source) {
29
		super(source);
30
	}
31

    
32
	/**
33
	 * Constructs a new ChangeEvent with the given source object and property
34
	 * name.
35
	 * 
36
	 * @param source
37
	 *            The source of the event
38
	 * @param property
39
	 *            The property name
40
	 */
41
	public ChangeEvent(Object source, String property) {
42
		super(source);
43
		setPropertyName(property);
44
	}
45

    
46
	/**
47
	 * Returns the name of the property that has changed.
48
	 * 
49
	 * @return String the name of the property that has changed
50
	 */
51
	public String getPropertyName() {
52
		return property;
53
	}
54

    
55
	/**
56
	 * Sets the name of the property that has changed.
57
	 * 
58
	 * @param string
59
	 *            The property name
60
	 */
61
	protected void setPropertyName(String string) {
62
		property = string;
63
	}
64

    
65
}
(34-34/171)