KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > launching > PropertyChangeEvent


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  *******************************************************************************/

11 package org.eclipse.jdt.launching;
12
13
14 import java.util.EventObject JavaDoc;
15 /**
16  * An event object describing a change to a named property.
17  * <p>
18  * JavaRuntime provides change notification for properties of VM installs
19  * </p>
20  * <p>
21  * Clients may instantiate this class; not intended to be subclassed.
22  * </p>
23  * @since 2.0
24  */

25 public class PropertyChangeEvent extends EventObject JavaDoc {
26     
27     /**
28      * All serializable objects should have a stable serialVersionUID
29      */

30     private static final long serialVersionUID = 1L;
31
32     /**
33      * The name of the changed property.
34      */

35     private String JavaDoc propertyName;
36     
37     /**
38      * The old value of the changed property, or <code>null</code> if
39      * not known or not relevant.
40      */

41     private Object JavaDoc oldValue;
42     
43     /**
44      * The new value of the changed property, or <code>null</code> if
45      * not known or not relevant.
46      */

47     private Object JavaDoc newValue;
48     
49     /**
50      * Creates a new property change event.
51      *
52      * @param source the object whose property has changed
53      * @param property the property that has changed (must not be
54      * <code>null</code>)
55      * @param oldValue the old value of the property, or
56      * <code>null</code> if none
57      * @param newValue the new value of the property, or
58      * <code>null</code> if none
59      */

60     public PropertyChangeEvent(
61         Object JavaDoc source,
62         String JavaDoc property,
63         Object JavaDoc oldValue,
64         Object JavaDoc newValue) {
65     
66         super(source);
67         if (property == null) {
68             throw new IllegalArgumentException JavaDoc();
69         }
70         this.propertyName = property;
71         this.oldValue = oldValue;
72         this.newValue = newValue;
73     }
74     
75     /**
76      * Returns the name of the property that changed.
77      *
78      * @return the name of the property that changed
79      */

80     public String JavaDoc getProperty() {
81         return propertyName;
82     }
83     
84     /**
85      * Returns the new value of the property.
86      *
87      * @return the new value, or <code>null</code> if not known
88      * or not relevant
89      */

90     public Object JavaDoc getNewValue() {
91         return newValue;
92     }
93     
94     /**
95      * Returns the old value of the property.
96      *
97      * @return the old value, or <code>null</code> if not known
98      * or not relevant
99      */

100     public Object JavaDoc getOldValue() {
101         return oldValue;
102     }
103 }
104
Popular Tags