org.eclipse.jpt.utility.model.event
Class PropertyChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.eclipse.jpt.utility.model.event.ChangeEvent
          extended by org.eclipse.jpt.utility.model.event.PropertyChangeEvent
All Implemented Interfaces:
java.io.Serializable

public class PropertyChangeEvent
extends ChangeEvent

A "property change" event gets delivered whenever a model changes a "bound" or "constrained" property. A PropertyChangeEvent is sent as an argument to the PropertyChangeListener. Provisional API: This class is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

See Also:
Serialized Form

Constructor Summary
PropertyChangeEvent(Model source, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Construct a new property change event.
 
Method Summary
 PropertyChangeEvent cloneWithSource(Model newSource)
          Return a copy of the event with the specified source replacing the current source.
 PropertyChangeEvent cloneWithSource(Model newSource, java.lang.String newPropertyName)
          Return a copy of the event with the specified source replacing the current source and the property name.
 java.lang.String getAspectName()
          Return the name of the aspect of the source that changed.
 java.lang.Object getNewValue()
          Return the new value of the property.
 java.lang.Object getOldValue()
          Return the old value of the property.
 java.lang.String getPropertyName()
          Return the programmatic name of the property that was changed.
 
Methods inherited from class org.eclipse.jpt.utility.model.event.ChangeEvent
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyChangeEvent

public PropertyChangeEvent(Model source,
                           java.lang.String propertyName,
                           java.lang.Object oldValue,
                           java.lang.Object newValue)
Construct a new property change event.

Parameters:
source - The object on which the event initially occurred.
propertyName - The programmatic name of the property that was changed.
oldValue - The old value of the property.
newValue - The new value of the property.
Method Detail

getPropertyName

public java.lang.String getPropertyName()
Return the programmatic name of the property that was changed.


getAspectName

public java.lang.String getAspectName()
Description copied from class: ChangeEvent
Return the name of the aspect of the source that changed. May be null if inappropriate.

Specified by:
getAspectName in class ChangeEvent

getOldValue

public java.lang.Object getOldValue()
Return the old value of the property.


getNewValue

public java.lang.Object getNewValue()
Return the new value of the property.


cloneWithSource

public PropertyChangeEvent cloneWithSource(Model newSource)
Description copied from class: ChangeEvent
Return a copy of the event with the specified source replacing the current source.

Specified by:
cloneWithSource in class ChangeEvent

cloneWithSource

public PropertyChangeEvent cloneWithSource(Model newSource,
                                           java.lang.String newPropertyName)
Return a copy of the event with the specified source replacing the current source and the property name.