Class DeleteFeatureForPattern
- All Implemented Interfaces:
ICustomAbortableUndoRedoFeature,ICustomUndoRedoFeature,IDeleteFeature,IFeature,IFeatureProviderHolder,IDelete,IDescription,IName
- Since:
- 0.8.0
-
Constructor Summary
ConstructorsConstructorDescriptionDeleteFeatureForPattern(IFeatureProvider featureProvider, IPattern pattern) Creates a newDeleteFeatureForPattern. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDelete(IDeleteContext context) Can delete hook.booleanDecides if the processed feature can be re-done.booleanDecides if the current feature can be undone - this is the undo of the execute operation.voiddelete(IDeleteContext context) Hook to implement the actual delete functionality.booleanIs 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.booleanisAbort()The Graphiti framework will call this method afterICustomUndoRedoFeature.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.booleanThe Graphiti framework will call this method afterIDelete.preDelete(IDeleteContext)has been called and before the actual delete is done.voidpostDelete(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.voidThis method will be called by the Graphiti framework after the EMF undo has finished.voidThis method will be called by the Graphiti framework after the EMF undo is finished.voidpreDelete(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.voidThis method will be called by the Graphiti framework before the EMF undo has triggered.voidThis method will be called by the Graphiti framework before the EMF undo is triggered.Methods inherited from class org.eclipse.graphiti.ui.features.DefaultDeleteFeature
canExecute, deleteBusinessObject, deleteBusinessObjects, execute, getDeleteName, getDescription, getName, getUserDecision, setDoneChangesMethods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature
addGraphicalRepresentation, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDiagram, getDiagramBehavior, getFeatureProvider, getProgressCallback, getUserDecision, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, manageDefaultFont, manageFont, manageFont, setProgressCallback, toString, updatePictogramElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.graphiti.features.IFeature
isAvailableMethods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder
getFeatureProvider
-
Constructor Details
-
DeleteFeatureForPattern
Creates a newDeleteFeatureForPattern.- Parameters:
featureProvider- the feature providerpattern- the pattern
-
-
Method Details
-
canDelete
Description copied from interface:IDeleteCan delete hook. Needs to be implemented in order to decide if a feature can (and wants to) handle a delete request.- Specified by:
canDeletein interfaceIDelete- Overrides:
canDeletein classDefaultDeleteFeature- Parameters:
context- the context describing the request- Returns:
true, if the feature can perform the delete operation
-
preDelete
Description copied from interface:IDeletePre delete hook that can be implemented by users to perform any operations that need to be done before the standard delete functionality starts. Be sure to callDefaultDeleteFeature#setDoneChanges(boolean)in case you modify any EMF objects to enable that the command stack gets updated.- Specified by:
preDeletein interfaceIDelete- Overrides:
preDeletein classDefaultDeleteFeature- Parameters:
context- the context
-
isDeleteAbort
public boolean isDeleteAbort()Description copied from interface:IDeleteThe Graphiti framework will call this method afterIDelete.preDelete(IDeleteContext)has been called and before the actual delete is done. In case this method returnstrue, the operation will be cancelled by the Graphiti framework by throwing anOperationCanceledExceptionthat 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.- Specified by:
isDeleteAbortin interfaceIDelete- Overrides:
isDeleteAbortin classDefaultDeleteFeature- Returns:
truein case you want to cancel the current operation,falseotherwise.- Since:
- 0.12
-
delete
Description copied from interface:IDeleteHook to implement the actual delete functionality.- Specified by:
deletein interfaceIDelete- Overrides:
deletein classDefaultDeleteFeature- Parameters:
context- the context
-
postDelete
Description copied from interface:IDeletePost delete hook that can be implemented by users to perform any operations that need to be done after the standard delete functionality ends.- Specified by:
postDeletein interfaceIDelete- Overrides:
postDeletein classDefaultDeleteFeature- Parameters:
context- the context
-
isAbort
public boolean isAbort()Description copied from interface:ICustomAbortableUndoRedoFeatureThe Graphiti framework will call this method afterICustomUndoRedoFeature.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 returnstrue, the operation will be cancelled by the Graphiti framework by throwing anOperationCanceledExceptionthat 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.- Specified by:
isAbortin interfaceICustomAbortableUndoRedoFeature- Returns:
truein case you want to cancel the current operation,falseotherwise.- Since:
- 0.12
-
canUndo
Description copied from interface:IFeatureDecides if the current feature can be undone - this is the undo of the execute operation.- Specified by:
canUndoin interfaceICustomUndoRedoFeature- Specified by:
canUndoin interfaceIFeature- Overrides:
canUndoin classAbstractFeature- Parameters:
context- this is the general input for this method- Returns:
- true if the feature can be undone, false if not
- See Also:
-
preUndo
Description copied from interface:ICustomUndoRedoFeatureThis method will be called by the Graphiti framework before the EMF undo is triggered. Customers may revert their non-EMF changes done by the feature here or inICustomUndoRedoFeature.postUndo(IContext).- Specified by:
preUndoin interfaceICustomUndoRedoFeature- Parameters:
context- this is the instance of theIContextobject that was in use when executing the feature- Since:
- 0.12
-
postUndo
Description copied from interface:ICustomUndoRedoFeatureThis method will be called by the Graphiti framework after the EMF undo is finished. Customers may revert their non-EMF changes done by the feature here or inICustomUndoRedoFeature.preUndo(IContext).- Specified by:
postUndoin interfaceICustomUndoRedoFeature- Parameters:
context- this is the instance of theIContextobject that was in use when executing the feature- Since:
- 0.12
-
canRedo
Description copied from interface:ICustomUndoRedoFeatureDecides 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. beforeICustomUndoRedoFeature.preRedo(IContext).Note that as soon as any feature reports
falsehere, also all consecutive entries in the command stack are no longer reachable for redo.- Specified by:
canRedoin interfaceICustomUndoRedoFeature- Parameters:
context- this is the instance of theIContextobject that was in use when executing the feature- Returns:
- true if the feature can be re-done, false if not
-
preRedo
Description copied from interface:ICustomUndoRedoFeatureThis 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 feature here or inICustomUndoRedoFeature.postRedo(IContext). (Usually it might be sufficient to delegate to the execution method of the feature.)- Specified by:
preRedoin interfaceICustomUndoRedoFeature- Parameters:
context- this is the instance of theIContextobject that was in use when executing the feature- Since:
- 0.12
-
postRedo
Description copied from interface:ICustomUndoRedoFeatureThis 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 feature here or inICustomUndoRedoFeature.preRedo(IContext). (Usually it might be sufficient to delegate to the execution method of the feature.)- Specified by:
postRedoin interfaceICustomUndoRedoFeature- Parameters:
context- this is the instance of theIContextobject that was in use when executing the feature- Since:
- 0.12
-
hasDoneChanges
public boolean hasDoneChanges()Description copied from interface:IFeatureIs 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. an editor. By default all features should appear there (see implementation inAbstractFeature), 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
falsealthough the feature did changes.- Specified by:
hasDoneChangesin interfaceIFeature- Overrides:
hasDoneChangesin classDefaultDeleteFeature- Returns:
trueif the feature should appear in the undo stack,falseotherwise
-