|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICustomUndoRedoPattern
This interface can by used and implemented by customers within any pattern to signal the need for additional work that needs to be done before or after undo and redo. When a pattern implements this interface, and the framework performs an undo or a redo, the framework will call the contained methods.
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.
ICustomAbortableUndoRedoPattern
Method Summary | |
---|---|
boolean |
canRedo(IFeature feature,
IContext context)
Decides if the processed feature can be re-done. |
boolean |
canUndo(IFeature feature,
IContext context)
Decides if the changes done by a processed pattern functionality can be undone. |
void |
postRedo(IFeature feature,
IContext context)
This method will be called by the Graphiti framework after the EMF undo has finished. |
void |
postUndo(IFeature feature,
IContext context)
This method will be called by the Graphiti framework after the EMF undo is finished. |
void |
preRedo(IFeature feature,
IContext context)
This method will be called by the Graphiti framework before the EMF undo has triggered. |
void |
preUndo(IFeature feature,
IContext context)
This method will be called by the Graphiti framework before the EMF undo is triggered. |
Method Detail |
---|
boolean canUndo(IFeature feature, IContext context)
#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.
feature
- this is the instance of the IFeature
object that was
in use when executing the pattern functionalitycontext
- this is the instance of the IContext
object that was
in use when executing the feature.
void preUndo(IFeature feature, IContext context)
#postUndo(IContext)
.
feature
- this is the instance of the IFeature
object that was
in use when executing the pattern functionalitycontext
- this is the instance of the IContext
object that was
in use when executing the featurevoid postUndo(IFeature feature, IContext context)
#preUndo(IContext)
.
feature
- this is the instance of the IFeature
object that was
in use when executing the pattern functionalitycontext
- this is the instance of the IContext
object that was
in use when executing the featureboolean canRedo(IFeature feature, IContext context)
#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.
feature
- this is the instance of the IFeature
object that was
in use when executing the pattern functionalitycontext
- this is the instance of the IContext
object that was
in use when executing the feature
void preRedo(IFeature feature, IContext context)
#postRedo(IContext)
. (Usually it
might be sufficient to delegate to the execution method of the feature.)
feature
- this is the instance of the IFeature
object that was
in use when executing the pattern functionalitycontext
- this is the instance of the IContext
object that was
in use when executing the featurevoid postRedo(IFeature feature, IContext context)
#preRedo(IContext)
. (Usually it
might be sufficient to delegate to the execution method of the feature.)
feature
- this is the instance of the IFeature
object that was
in use when executing the pattern functionalitycontext
- this is the instance of the IContext
object that was
in use when executing the feature
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |