|
|||||||||||
| 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.
| Nested Class Summary | |
protected static class |
ChangeRecorder.FastEList
|
| 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)
|
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)
|
ChangeDescription |
endRecording()
|
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)
|
protected void |
handleResource(Notification notification)
|
boolean |
isAdapterForType(Object type)
Returns whether the adapter is of the given type. |
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. |
| 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 void beginRecording(Collection rootObjects)
public ChangeDescription endRecording()
public void notifyChanged(Notification notification)
Adapter
notifyChanged in interface Adapternotification - a description of the change.
protected void handleFeature(EStructuralFeature feature,
EReference containment,
Notification notification)
protected void handleResource(Notification notification)
public void setTarget(Notifier target)
setTarget in interface Adaptertarget - the new notifier.Adapter.getTarget()protected void addAdapter(Notifier notifier)
public Notifier getTarget()
Adapter
getTarget in interface AdapterAdapter.setTarget(org.eclipse.emf.common.notify.Notifier)public boolean isAdapterForType(Object type)
Adapter
isAdapterForType in interface Adaptertype - 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 | ||||||||||