01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.jdt.launching;
11:
12: import java.util.EventObject;
13:
14: /**
15: * An event object describing a change to a named property.
16: * <p>
17: * JavaRuntime provides change notification for properties of VM installs
18: * </p>
19: * <p>
20: * Clients may instantiate this class; not intended to be subclassed.
21: * </p>
22: * @since 2.0
23: */
24: public class PropertyChangeEvent extends EventObject {
25:
26: /**
27: * All serializable objects should have a stable serialVersionUID
28: */
29: private static final long serialVersionUID = 1L;
30:
31: /**
32: * The name of the changed property.
33: */
34: private String propertyName;
35:
36: /**
37: * The old value of the changed property, or <code>null</code> if
38: * not known or not relevant.
39: */
40: private Object oldValue;
41:
42: /**
43: * The new value of the changed property, or <code>null</code> if
44: * not known or not relevant.
45: */
46: private Object newValue;
47:
48: /**
49: * Creates a new property change event.
50: *
51: * @param source the object whose property has changed
52: * @param property the property that has changed (must not be
53: * <code>null</code>)
54: * @param oldValue the old value of the property, or
55: * <code>null</code> if none
56: * @param newValue the new value of the property, or
57: * <code>null</code> if none
58: */
59: public PropertyChangeEvent(Object source, String property,
60: Object oldValue, Object newValue) {
61:
62: super (source);
63: if (property == null) {
64: throw new IllegalArgumentException();
65: }
66: this .propertyName = property;
67: this .oldValue = oldValue;
68: this .newValue = newValue;
69: }
70:
71: /**
72: * Returns the name of the property that changed.
73: *
74: * @return the name of the property that changed
75: */
76: public String getProperty() {
77: return propertyName;
78: }
79:
80: /**
81: * Returns the new value of the property.
82: *
83: * @return the new value, or <code>null</code> if not known
84: * or not relevant
85: */
86: public Object getNewValue() {
87: return newValue;
88: }
89:
90: /**
91: * Returns the old value of the property.
92: *
93: * @return the old value, or <code>null</code> if not known
94: * or not relevant
95: */
96: public Object getOldValue() {
97: return oldValue;
98: }
99: }
|