|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.ecore.change.util.ListDifferenceAnalyzer org.eclipse.emf.ecore.change.util.BasicChangeRecorder org.eclipse.emf.ecore.change.util.ChangeRecorder
public class 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 |
---|
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter |
---|
Adapter.Internal |
Field Summary | |
---|---|
protected boolean |
loadingTargets
|
protected java.util.List<Notifier> |
originalTargetObjects
|
protected boolean |
resolveProxies
|
protected java.util.List<Notifier> |
targetObjects
|
Fields inherited from class org.eclipse.emf.ecore.change.util.BasicChangeRecorder |
---|
changeDescription, recording |
Constructor Summary | |
---|---|
ChangeRecorder()
|
|
ChangeRecorder(java.util.Collection<?> rootObjects)
|
|
ChangeRecorder(EObject rootObject)
|
|
ChangeRecorder(Resource resource)
|
|
ChangeRecorder(ResourceSet resourceSet)
|
Method Summary | |
---|---|
protected void |
addAdapter(Notifier notifier)
|
void |
beginRecording(ChangeDescription changeDescription,
java.util.Collection<?> rootObjects)
Begins recording any changes made to the elements of the specified collection, adding the changes to and existing ChangeDescription . |
void |
beginRecording(java.util.Collection<?> rootObjects)
Begins recording any changes made to the elements of the specified collection. |
protected void |
consolidateChanges()
Consolidates the changes that have happen since the last consolidation. |
void |
dispose()
Disposes this change recorder. |
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(java.lang.Object type)
Returns whether the adapter is of the given type. |
protected boolean |
isOrphan(EObject eObject)
|
boolean |
isResolveProxies()
|
void |
notifyChanged(Notification notification)
Notifies that a change to some feature has occurred. |
protected void |
prepareChangeDescriptionForResume()
Prepares this ChangeRecorder's BasicChangeRecorder.changeDescription for the scenarios where the user
is resuming a previous recording. |
protected void |
removeAdapter(Notifier notifier)
|
void |
setResolveProxies(boolean resolveProxies)
|
void |
setTarget(Notifier target)
Handles installation of the adapter by adding the adapter to each of the directly contained objects. |
protected boolean |
shouldRecord(EStructuralFeature feature,
EReference containment,
Notification notification,
EObject eObject)
|
void |
unsetTarget(Notifier oldTarget)
Unsets the target from which the adapter will receive notification. |
Methods inherited from class org.eclipse.emf.ecore.change.util.BasicChangeRecorder |
---|
createChangeDescription, createFeatureChange, createResourceChange, eliminateEmptyChanges, endRecording, finalizeChange, finalizeChange, getChangeDescription, getFeatureChange, getFeatureChanges, getResourceChange, getResourceChanges, isRecording, setChangeDescription, setRecording, shouldRecord, summarize |
Methods inherited from class org.eclipse.emf.ecore.change.util.ListDifferenceAnalyzer |
---|
analyzeLists, analyzeLists, createAddListChange, createListChange, createListChanges, createMoveListChange, createRemoveListChange |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<Notifier> targetObjects
protected java.util.List<Notifier> originalTargetObjects
protected boolean loadingTargets
protected boolean resolveProxies
Constructor Detail |
---|
public ChangeRecorder()
public ChangeRecorder(EObject rootObject)
public ChangeRecorder(Resource resource)
public ChangeRecorder(ResourceSet resourceSet)
public ChangeRecorder(java.util.Collection<?> rootObjects)
Method Detail |
---|
public boolean isResolveProxies()
public void setResolveProxies(boolean resolveProxies)
public void dispose()
BasicChangeRecorder
dispose
in class BasicChangeRecorder
protected void removeAdapter(Notifier notifier)
public void beginRecording(java.util.Collection<?> rootObjects)
rootObjects
- A collection of instances of Notifier
public void beginRecording(ChangeDescription changeDescription, java.util.Collection<?> rootObjects)
ChangeDescription
.
This allows clients to resume a previous recording.
Unpredictable (and probably bad) results may happen if the change description is inconsistent with the current state of the application.
changeDescription
- A change description with changes made during a previous
recording or null if a new change description should be instantiated.rootObjects
- A collection of instances of Notifier
protected void prepareChangeDescriptionForResume()
BasicChangeRecorder.changeDescription
for the scenarios where the user
is resuming a previous recording.
beginRecording(ChangeDescription, Collection)
protected void consolidateChanges()
BasicChangeRecorder
consolidateChanges
in class BasicChangeRecorder
protected boolean isOrphan(EObject eObject)
public void notifyChanged(Notification notification)
Adapter
notifyChanged
in interface Adapter
notification
- a description of the change.protected boolean shouldRecord(EStructuralFeature feature, EReference containment, Notification notification, EObject eObject)
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()
public void unsetTarget(Notifier oldTarget)
Adapter.Internal
unsetTarget
in interface Adapter.Internal
oldTarget
- the old notifier.Adapter.getTarget()
,
Adapter.setTarget(Notifier)
protected void addAdapter(Notifier notifier)
public Notifier getTarget()
Adapter
getTarget
in interface Adapter
Adapter.setTarget(org.eclipse.emf.common.notify.Notifier)
public boolean isAdapterForType(java.lang.Object type)
Adapter
isAdapterForType
in interface Adapter
type
- the type.
AdapterFactory.isFactoryForType(java.lang.Object)
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |