Interface ICustomUndoRedoPattern
- All Known Subinterfaces:
ICustomAbortableUndoRedoPattern
Implementing this interface is especially helpful if customers want to
implement undo/redo functionality for non-EMF changes, e.g. for non-EMF
domain models. Note that any EMF-model change (including the changes done to
the graphical representation (Graphiti PictogramElement
s and
GraphicsAlgorithm
s will by handled automatically by the Graphiti
framework no matter if this interface is implemented by a pattern or not. The
pattern may use the context and feature objects (e.g. the contained
properties set) passed to the contained methods while executing the pattern
in order to collect any information needed for undo.
In case you want to cancel undo/redo operations in #preUndo(IContext)
/#preRedo(IContext)
, you need to implement
ICustomAbortableUndoRedoPattern
which offers an
ICustomAbortableUndoRedoPattern.isAbort()
method that causes the
cancellation of undo/redo operation in case true
is returned.
- Since:
- 0.12
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Decides if the processed feature can be re-done.boolean
Decides if the changes done by a processed pattern functionality can be undone.void
This method will be called by the Graphiti framework after the EMF undo has finished.void
This method will be called by the Graphiti framework after the EMF undo is finished.void
This method will be called by the Graphiti framework before the EMF undo has triggered.void
This method will be called by the Graphiti framework before the EMF undo is triggered.
-
Method Details
-
canUndo
Decides if the changes done by a processed pattern functionality can be undone. This method is called once by the Graphiti framework just before any undo work is started, e.g. before#preUndo(IContext)
.Note that as soon as any pattern reports
false
here, also all previous entries in the command stack are no longer reachable for undo. -
preUndo
This method will be called by the Graphiti framework before the EMF undo is triggered. Customers may revert their non-EMF changes done by the pattern functionality here or in#postUndo(IContext)
. -
postUndo
This method will be called by the Graphiti framework after the EMF undo is finished. Customers may revert their non-EMF changes done by the pattern functionality here or in#preUndo(IContext)
. -
canRedo
Decides if the processed feature can be re-done. This method is called once by the Graphiti framework just before any redo work is started, e.g. before#preRedo(IContext)
.Note that as soon as any pattern reports
false
here, also all consecutive entries in the command stack are no longer reachable for redo. -
preRedo
This method will be called by the Graphiti framework before the EMF undo has triggered. Customers may re-apply their non-EMF changes done by the pattern functionality here or in#postRedo(IContext)
. (Usually it might be sufficient to delegate to the execution method of the feature.) -
postRedo
This method will be called by the Graphiti framework after the EMF undo has finished. Customers may re-apply their non-EMF changes done by the pattern functionality here or in#preRedo(IContext)
. (Usually it might be sufficient to delegate to the execution method of the feature.)
-