Package org.eclipse.jface.util
Class PropertyChangeEvent
java.lang.Object
java.util.EventObject
org.eclipse.jface.util.PropertyChangeEvent
- All Implemented Interfaces:
Serializable
An event object describing a change to a named property.
This concrete class was designed to be instantiated, but may also be subclassed if required.
The JFace frameworks contain classes that report property
change events for internal state changes that may be of interest
to external parties. A special listener interface
(IPropertyChangeListener
) is defined for this purpose,
and a typical class allow listeners to be registered via
an addPropertyChangeListener
method.
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionPropertyChangeEvent
(Object source, String property, Object oldValue, Object newValue) Creates a new property change event. -
Method Summary
Modifier and TypeMethodDescriptionReturns the new value of the property.Returns the old value of the property.Returns the name of the property that changed.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
PropertyChangeEvent
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 Details
-
getNewValue
Returns the new value of the property.- Returns:
- the new value, or
null
if not known or not relevant (for instance if the property was removed).
-
getOldValue
Returns the old value of the property.- Returns:
- the old value, or
null
if not known or not relevant (for instance if the property was just added and there was no old value).
-
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
-