org.eclipse.emf.workspace.util
Class OperationChangeDescription
java.lang.Object
org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.EObjectImpl
org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl
org.eclipse.emf.workspace.util.OperationChangeDescription
- All Implemented Interfaces:
- Notifier, ChangeDescription, EObject, InternalEObject, TransactionChangeDescription
public class OperationChangeDescription
- extends ChangeDescriptionImpl
- implements TransactionChangeDescription
A change description that simply wraps an IUndoableOperation
, asking
it to undo or redo when applying
.
Note that this class is not intended to be used by clients. It is
only needed by service providers extending this API.
Method Summary |
void |
apply()
I apply my change by undoing the encapsulated operation. |
void |
applyAndReverse()
I apply-and-reverse by alternately undoing and redoing the encapsulated
operation. |
boolean |
canApply()
I can apply if my wrapped operation can undo or redo, according to whether
it was last undone or redone. |
void |
dispose()
Forgets my operation and clears my reference to the adaptable. |
boolean |
isEmpty()
I can only assume that the operation I wrap makes some kind of change. |
Methods inherited from class org.eclipse.emf.ecore.change.impl.ChangeDescriptionImpl |
eGet, eInverseRemove, eIsSet, eSet, eStaticClass, eUnset, getContainedEObjects, getObjectChanges, getObjectsToAttach, getObjectsToDetach, getObjectsToDetachGen, getOldContainer, getOldContainmentFeature, getOldContainmentInformation, getResourceChanges, preApply |
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl |
eAdapters, eBasicAdapters, eBasicProperties, eBasicSetContainer, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eIsProxy, eProperties, eSetClass, eSetDeliver, eSetProxyURI |
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl |
eAddVirtualValue, eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eComputeVirtualValuesCapacity, eContainer, eContainerAdapterArray, eContainingFeature, eContainmentFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicClass, eDynamicFeature, eDynamicFeatureID, eDynamicGet, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInverseRemove, eDynamicIsSet, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eHasSettings, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eRemoveVirtualValue, eResolveProxy, eResource, eSet, eSetDirectResource, eSetResource, eSetStore, eSetting, eSettingDelegate, eSettings, eSetVirtualIndexBits, eSetVirtualValue, eSetVirtualValues, eStaticFeatureCount, eStore, eUnset, eURIFragmentSegment, eVirtualBitCount, eVirtualGet, eVirtualGet, eVirtualIndex, eVirtualIndexBits, eVirtualIsSet, eVirtualSet, eVirtualUnset, eVirtualValue, eVirtualValues, toString |
Methods inherited from interface org.eclipse.emf.ecore.EObject |
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset |
OperationChangeDescription
public OperationChangeDescription(IUndoableOperation operation,
IAdaptable info)
- Initializes me with the undoable operation that I encapsulate and the
adaptable with which it was originally executed.
- Parameters:
operation
- the operation that I encapsulateinfo
- the adaptable to provide when undoing or redoing the operation
canApply
public boolean canApply()
- I can apply if my wrapped operation can undo or redo, according to whether
it was last undone or redone.
- Specified by:
canApply
in interface TransactionChangeDescription
- Returns:
true
if my operation can undo/redo;
false
, otherwise- See Also:
IUndoableOperation.canUndo()
,
IUndoableOperation.canRedo()
apply
public void apply()
- I apply my change by undoing the encapsulated operation. After it is
undone, I dispose myself.
- Specified by:
apply
in interface ChangeDescription
- Overrides:
apply
in class ChangeDescriptionImpl
applyAndReverse
public void applyAndReverse()
- I apply-and-reverse by alternately undoing and redoing the encapsulated
operation.
- Specified by:
applyAndReverse
in interface ChangeDescription
- Overrides:
applyAndReverse
in class ChangeDescriptionImpl
isEmpty
public boolean isEmpty()
- I can only assume that the operation I wrap makes some kind of change.
- Specified by:
isEmpty
in interface TransactionChangeDescription
- Returns:
false
, always
dispose
public void dispose()
- Forgets my operation and clears my reference to the adaptable.