public class DeleteFeatureForPattern extends DefaultDeleteFeature implements ICustomAbortableUndoRedoFeature
| Constructor and Description |
|---|
DeleteFeatureForPattern(IFeatureProvider featureProvider,
IPattern pattern)
Creates a new
DeleteFeatureForPattern. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDelete(IDeleteContext context)
Can delete hook.
|
boolean |
canRedo(IContext context)
Decides if the processed feature can be re-done.
|
boolean |
canUndo(IContext context)
Decides if the current feature can be undone - this is the undo of the
execute operation.
|
void |
delete(IDeleteContext context)
Hook to implement the actual delete functionality.
|
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 |
isDeleteAbort()
The Graphiti framework will call this method after
IDelete.preDelete(IDeleteContext) has been called and before the actual
delete is done. |
void |
postDelete(IDeleteContext context)
Post delete hook that can be implemented by users to perform any
operations that need to be done after the standard delete functionality
ends.
|
void |
postRedo(IContext context)
This method will be called by the Graphiti framework after the EMF undo
has finished.
|
void |
postUndo(IContext context)
This method will be called by the Graphiti framework after the EMF undo
is finished.
|
void |
preDelete(IDeleteContext context)
Pre delete hook that can be implemented by users to perform any
operations that need to be done before the standard delete functionality
starts.
|
void |
preRedo(IContext context)
This method will be called by the Graphiti framework before the EMF undo
has triggered.
|
void |
preUndo(IContext context)
This method will be called by the Graphiti framework before the EMF undo
is triggered.
|
canExecute, execute, getDescription, getNamegetFeatureProvider, isAvailable, manageFont, manageFont, setProgressCallback, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitisAvailablegetFeatureProviderpublic DeleteFeatureForPattern(IFeatureProvider featureProvider, IPattern pattern)
DeleteFeatureForPattern.featureProvider - the feature providerpattern - the patternpublic boolean canDelete(IDeleteContext context)
IDeletecanDelete in interface IDeletecanDelete in class DefaultDeleteFeaturecontext - the context describing the requesttrue, if the feature can perform the delete
operationpublic void preDelete(IDeleteContext context)
IDeleteDefaultDeleteFeature#setDoneChanges(boolean) in case you modify
any EMF objects to enable that the command stack gets updated.preDelete in interface IDeletepreDelete in class DefaultDeleteFeaturecontext - the contextpublic boolean isDeleteAbort()
IDeleteIDelete.preDelete(IDeleteContext) has been called and before the actual
delete 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
IDelete.preDelete(IDeleteContext) as cancellation indication and check
that that flag here.
isDeleteAbort in interface IDeleteisDeleteAbort in class DefaultDeleteFeaturetrue in case you want to cancel the current
operation, false otherwise.public void delete(IDeleteContext context)
IDeletedelete in interface IDeletedelete in class DefaultDeleteFeaturecontext - the contextpublic void postDelete(IDeleteContext context)
IDeletepostDelete in interface IDeletepostDelete in class DefaultDeleteFeaturecontext - the contextpublic boolean isAbort()
ICustomAbortableUndoRedoFeatureICustomUndoRedoFeature.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 ICustomAbortableUndoRedoFeaturetrue in case you want to cancel the current
operation, false otherwise.public boolean canUndo(IContext context)
IFeaturecanUndo in interface ICustomUndoRedoFeaturecanUndo in interface IFeaturecanUndo in class AbstractFeaturecontext - this is the general input for this methodIContextpublic void preUndo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.postUndo(IContext).preUndo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void postUndo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.preUndo(IContext).postUndo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic boolean canRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.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 ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void preRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.postRedo(IContext). (Usually it might be
sufficient to delegate to the execution method of the feature.)preRedo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void postRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.preRedo(IContext). (Usually it might be
sufficient to delegate to the execution method of the feature.)postRedo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic boolean hasDoneChanges()
IFeatureAbstractFeature), 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 IFeaturehasDoneChanges in class DefaultDeleteFeaturetrue if the feature should appear in the undo stack,
false otherwise