|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.ecore.change.util.ChangeRecorder
A change recorder for the tree contents of a collection of EObjects. It monitors the specified objects and
then produces a change model
representing the changes needed to reverse (undo) all
the model changes made while recording.
Field Summary | |
protected ChangeDescription |
changeDescription
|
protected List |
initialTargetObjects
|
protected boolean |
loadingTargets
|
protected boolean |
recording
|
protected List |
targetObjects
|
Constructor Summary | |
ChangeRecorder()
|
|
ChangeRecorder(Collection rootObjects)
|
|
ChangeRecorder(EObject rootObject)
|
|
ChangeRecorder(Resource resource)
|
|
ChangeRecorder(ResourceSet resourceSet)
|
Method Summary | |
protected void |
addAdapter(Notifier notifier)
|
void |
beginRecording(Collection rootObjects)
Begins recording any changes made to the elements of the specifed collection. |
protected void |
consolidateChanges()
Consolidates the changes that have happen since the last consolidation. |
protected void |
createAddListChange(EList oldList,
EList changesList,
Object newObject,
int index)
Convenience method added to allow subclasses to modify the default implementation for the scenario in which an element was added to the monitored list. |
protected ChangeDescription |
createChangeDescription()
|
protected FeatureChange |
createFeatureChange(EObject eObject,
EStructuralFeature eStructuralFeature,
Object value,
boolean isSet)
|
protected ListChange |
createListChange(EList changesList,
ChangeKind kind,
int index)
|
protected void |
createListChanges(EList oldList,
EList newList,
EList changesList)
|
protected void |
createMoveListChange(EList oldList,
EList changesList,
Object newObject,
int index,
int toIndex)
Convenience method added to allow subclasses to modify the default implementation for the scenario in which an element was moved in the monitored list. |
protected void |
createRemoveListChange(EList oldList,
EList changesList,
Object newObject,
int index)
Convenience method added to allow subclasses to modify the default implementation for the scenario in which an element was removed from the monitored list. |
protected ResourceChange |
createResourceChange(Resource resource,
EList value)
|
void |
dispose()
Disposes this change recorder by detaching it from its targets, clearing the collections attributes and setting the internal reference to the change description to null. |
ChangeDescription |
endRecording()
Ends the recording. |
protected void |
finalizeChange(FeatureChange change,
EObject eObject)
|
protected void |
finalizeChange(ResourceChange change)
|
protected FeatureChange |
getFeatureChange(List featureChanges,
EStructuralFeature eStructuralFeature)
|
protected List |
getFeatureChanges(EObject eObject)
|
protected ResourceChange |
getResourceChange(Resource resource)
|
protected EList |
getResourceChanges()
|
Notifier |
getTarget()
Returns the target from which the adapter receives notification. |
protected void |
handleFeature(EStructuralFeature feature,
EReference containment,
Notification notification,
EObject eObject)
|
protected void |
handleResource(Notification notification)
|
boolean |
isAdapterForType(Object type)
Returns whether the adapter is of the given type. |
boolean |
isRecording()
|
void |
notifyChanged(Notification notification)
Notifies that a change to some feature has occurred. |
void |
setTarget(Notifier target)
Handles installation of the adapter by adding the adapter to each of the directly contained objects. |
ChangeDescription |
summarize()
Summarizes the changes made to the analysed objects on the change description
returned by the endRecording() without ending the recording.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean recording
protected ChangeDescription changeDescription
protected List targetObjects
protected List initialTargetObjects
protected boolean loadingTargets
Constructor Detail |
public ChangeRecorder()
public ChangeRecorder(EObject rootObject)
public ChangeRecorder(Resource resource)
public ChangeRecorder(ResourceSet resourceSet)
public ChangeRecorder(Collection rootObjects)
Method Detail |
public boolean isRecording()
public void dispose()
public void beginRecording(Collection rootObjects)
rootObjects
- A collecion of instances of (@link Notifier}public ChangeDescription summarize()
change description
returned by the endRecording()
without ending the recording.
This method doesn't do anything if this ChangeRecorder is not recording.
ChangeDescription
or null if there is nothing being recorded.public ChangeDescription endRecording()
ChangeDescription
or null if there is nothing being recorded.protected void consolidateChanges()
public void notifyChanged(Notification notification)
Adapter
notifyChanged
in interface Adapter
notification
- a description of the change.protected void handleFeature(EStructuralFeature feature, EReference containment, Notification notification, EObject eObject)
protected void handleResource(Notification notification)
public void setTarget(Notifier target)
setTarget
in interface Adapter
target
- the new notifier.Adapter.getTarget()
protected void addAdapter(Notifier notifier)
public Notifier getTarget()
Adapter
getTarget
in interface Adapter
Adapter.setTarget(org.eclipse.emf.common.notify.Notifier)
public boolean isAdapterForType(Object type)
Adapter
isAdapterForType
in interface Adapter
type
- the type.
AdapterFactory.isFactoryForType(java.lang.Object)
protected EList getResourceChanges()
protected ResourceChange getResourceChange(Resource resource)
protected List getFeatureChanges(EObject eObject)
protected FeatureChange getFeatureChange(List featureChanges, EStructuralFeature eStructuralFeature)
protected void finalizeChange(ResourceChange change)
protected void finalizeChange(FeatureChange change, EObject eObject)
protected void createListChanges(EList oldList, EList newList, EList changesList)
protected void createAddListChange(EList oldList, EList changesList, Object newObject, int index)
createListChanges(EList, EList, EList)
protected void createRemoveListChange(EList oldList, EList changesList, Object newObject, int index)
createListChanges(EList, EList, EList)
protected void createMoveListChange(EList oldList, EList changesList, Object newObject, int index, int toIndex)
createListChanges(EList, EList, EList)
protected ListChange createListChange(EList changesList, ChangeKind kind, int index)
protected FeatureChange createFeatureChange(EObject eObject, EStructuralFeature eStructuralFeature, Object value, boolean isSet)
protected ResourceChange createResourceChange(Resource resource, EList value)
protected ChangeDescription createChangeDescription()
|
Copyright 2001-2004 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |