public class RemoveFeatureForPattern extends DefaultRemoveFeature implements ICustomAbortableUndoRedoFeature
Constructor and Description |
---|
RemoveFeatureForPattern(IFeatureProvider featureProvider,
IPattern pattern)
Creates a new
RemoveFeatureForPattern . |
Modifier and Type | Method and Description |
---|---|
boolean |
canRedo(IContext context)
Decides if the processed feature can be re-done.
|
boolean |
canRemove(IRemoveContext context)
Checks if given object could be removed.
|
boolean |
canUndo(IContext context)
Decides if the current feature can be undone - this is the undo of the
execute operation.
|
boolean |
hasDoneChanges()
Is queried by the framework after a feature has been executed to find out
if this feature should appear in the undo stack of e.g.
|
boolean |
isAbort()
The Graphiti framework will call this method after
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext) /
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext) have
been called and before the actual undo/redo operation is triggered. |
boolean |
isRemoveAbort()
The Graphiti framework will call this method after
IRemove.preRemove(IRemoveContext) has been called and before the actual
remove is done. |
void |
postRedo(IContext context)
This method will be called by the Graphiti framework after the EMF undo
has finished.
|
void |
postRemove(IRemoveContext context)
called after remove call.
|
void |
postUndo(IContext context)
This method will be called by the Graphiti framework after the EMF undo
is finished.
|
void |
preRedo(IContext context)
This method will be called by the Graphiti framework before the EMF undo
has triggered.
|
void |
preRemove(IRemoveContext context)
called prior to remove call.
|
void |
preUndo(IContext context)
This method will be called by the Graphiti framework before the EMF undo
is triggered.
|
void |
remove(IRemoveContext context)
Remove the given object.
|
canExecute, execute, getDescription, getName
getFeatureProvider, isAvailable, manageFont, manageFont, setProgressCallback, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
isAvailable
getFeatureProvider
public RemoveFeatureForPattern(IFeatureProvider featureProvider, IPattern pattern)
RemoveFeatureForPattern
.featureProvider
- the feature providerpattern
- the patternpublic boolean canRemove(IRemoveContext context)
IRemove
canRemove
in interface IRemove
canRemove
in class DefaultRemoveFeature
context
- contains object to removepublic void preRemove(IRemoveContext context)
IRemove
preRemove
in interface IRemove
preRemove
in class DefaultRemoveFeature
context
- the contextpublic boolean isRemoveAbort()
IRemove
IRemove.preRemove(IRemoveContext)
has been called and before the actual
remove is done. In case this method returns true
, the
operation will be cancelled by the Graphiti framework by throwing an
OperationCanceledException
that causes am EMF revert of the
operation.
Implementing classes might e.g. set a flag in
IRemove.preRemove(IRemoveContext)
as cancellation indication and check
that that flag here.
isRemoveAbort
in interface IRemove
isRemoveAbort
in class DefaultRemoveFeature
true
in case you want to cancel the current
operation, false
otherwise.public void remove(IRemoveContext context)
IRemove
remove
in interface IRemove
remove
in class DefaultRemoveFeature
context
- contains object to removepublic void postRemove(IRemoveContext context)
IRemove
postRemove
in interface IRemove
postRemove
in class DefaultRemoveFeature
context
- the contextpublic boolean isAbort()
ICustomAbortableUndoRedoFeature
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)
/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext)
have
been called and before the actual undo/redo operation is triggered. In
case this method returns true
, the operation will be
cancelled by the Graphiti framework by throwing an
OperationCanceledException
that causes am EMF revert of the
operation.
Implementing classes might e.g. set a flag in
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)
/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext)
as
cancellation indication and check that that flag here.
isAbort
in interface ICustomAbortableUndoRedoFeature
true
in case you want to cancel the current
operation, false
otherwise.public boolean canUndo(IContext context)
IFeature
canUndo
in interface ICustomUndoRedoFeature
canUndo
in interface IFeature
canUndo
in class AbstractFeature
context
- this is the general input for this methodIContext
public void preUndo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.postUndo(IContext)
.preUndo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic void postUndo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.preUndo(IContext)
.postUndo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic boolean canRedo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.preRedo(IContext)
.
Note that as soon as any feature reports false
here, also
all consecutive entries in the command stack are no longer reachable for
redo.
canRedo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic void preRedo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.postRedo(IContext)
. (Usually it might be
sufficient to delegate to the execution method of the feature.)preRedo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic void postRedo(IContext context)
ICustomUndoRedoFeature
ICustomUndoRedoFeature.preRedo(IContext)
. (Usually it might be
sufficient to delegate to the execution method of the feature.)postRedo
in interface ICustomUndoRedoFeature
context
- this is the instance of the IContext
object that was
in use when executing the featurepublic boolean hasDoneChanges()
IFeature
AbstractFeature
), but features may decide to override this
behavior. Note that this is a dynamic attribute of the feature that is
queried each time after the feature has been executed.
IMPORTANT NOTE: The implementor of the feature is responsible for
correctly implementing this method! It might lead to inconsistencies in
the command stack if this method returns false
although the
feature did changes.
hasDoneChanges
in interface IFeature
hasDoneChanges
in class AbstractFeature
true
if the feature should appear in the undo stack,
false
otherwise