Package org.eclipse.core.runtime
Class Preferences.PropertyChangeEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.eclipse.core.runtime.Preferences.PropertyChangeEvent
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Preferences
public static class Preferences.PropertyChangeEvent extends EventObject
An event object describing a change to a named property.The preferences object reports property change events for internal state changes that may be of interest to external parties. A special listener interface (
Preferences.IPropertyChangeListener
) is defined for this purpose. Listeners are registered via thePreferences.addPropertyChangeListener
method.Clients cannot instantiate or subclass this class.
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PropertyChangeEvent(Object source, String property, Object oldValue, Object newValue)
Creates a new property change event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getNewValue()
Returns the new value of the property.Object
getOldValue()
Returns the old value of the property.String
getProperty()
Returns the name of the property that changed.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
PropertyChangeEvent
protected PropertyChangeEvent(Object source, String property, Object oldValue, Object newValue)
Creates a new property change event.- Parameters:
source
- the object whose property has changedproperty
- the property that has changed (must not benull
)oldValue
- the old value of the property, ornull
if nonenewValue
- the new value of the property, ornull
if none
-
-
Method Detail
-
getProperty
public String getProperty()
Returns the name of the property that changed.Warning: there is no guarantee that the property name returned is a constant string. Callers must compare property names using
equals
, not ==.- Returns:
- the name of the property that changed
-
getNewValue
public Object getNewValue()
Returns the new value of the property.- Returns:
- the new value, or
null
if not known or not relevant
-
getOldValue
public Object getOldValue()
Returns the old value of the property.- Returns:
- the old value, or
null
if not known or not relevant
-
-