Package org.eclipse.pde.core
Class ModelChangedEvent
java.lang.Object
org.eclipse.pde.core.ModelChangedEvent
- All Implemented Interfaces:
IModelChangedEvent
- Since:
- 2.0
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Field Summary
Fields inherited from interface org.eclipse.pde.core.IModelChangedEvent
CHANGE, INSERT, REMOVE, WORLD_CHANGED
-
Constructor Summary
ConstructorDescriptionModelChangedEvent
(IModelChangeProvider provider, int type, Object[] objects, String changedProperty) The constructor of the event.ModelChangedEvent
(IModelChangeProvider provider, Object object, String changedProperty, Object oldValue, Object newValue) A costructor that should be used for changes of object properties. -
Method Summary
Modifier and TypeMethodDescriptionObject[]
Returns an array of model objects that are affected by the change.Returns a name of the object's property that has been changed if change type is CHANGE.Returns the provider that fired this event.int
Returns the type of change that occured in the model (one of INSERT, REMOVE, CHANGE or WORLD_CHANGED ).When model change is of type CHANGE, this method is used to obtain the new value of the property (after the change).When model change is of type CHANGE, this method is used to obtain the old value of the property (before the change).
-
Constructor Details
-
ModelChangedEvent
public ModelChangedEvent(IModelChangeProvider provider, int type, Object[] objects, String changedProperty) The constructor of the event.- Parameters:
provider
- the change providertype
- the event typeobjects
- the changed objectschangedProperty
- or null if not applicable
-
ModelChangedEvent
public ModelChangedEvent(IModelChangeProvider provider, Object object, String changedProperty, Object oldValue, Object newValue) A costructor that should be used for changes of object properties.- Parameters:
provider
- the event providerobject
- affected objectchangedProperty
- changed property of the affected objectoldValue
- the value before the changenewValue
- the value after the change
-
-
Method Details
-
getChangeProvider
Description copied from interface:IModelChangedEvent
Returns the provider that fired this event.- Specified by:
getChangeProvider
in interfaceIModelChangedEvent
- Returns:
- the event provider
-
getChangedObjects
Description copied from interface:IModelChangedEvent
Returns an array of model objects that are affected by the change.- Specified by:
getChangedObjects
in interfaceIModelChangedEvent
- Returns:
- array of affected objects
-
getChangedProperty
Description copied from interface:IModelChangedEvent
Returns a name of the object's property that has been changed if change type is CHANGE.- Specified by:
getChangedProperty
in interfaceIModelChangedEvent
- Returns:
- property that has been changed in the model object, or null if type is not CHANGE or if more than one property has been changed.
-
getOldValue
Description copied from interface:IModelChangedEvent
When model change is of type CHANGE, this method is used to obtain the old value of the property (before the change).- Specified by:
getOldValue
in interfaceIModelChangedEvent
- Returns:
- the old value of the changed property
-
getNewValue
Description copied from interface:IModelChangedEvent
When model change is of type CHANGE, this method is used to obtain the new value of the property (after the change).- Specified by:
getNewValue
in interfaceIModelChangedEvent
- Returns:
- the new value of the changed property.
-
getChangeType
public int getChangeType()Description copied from interface:IModelChangedEvent
Returns the type of change that occured in the model (one of INSERT, REMOVE, CHANGE or WORLD_CHANGED ).- Specified by:
getChangeType
in interfaceIModelChangedEvent
- Returns:
- type of change
-