Class DefaultRemoveFeature
java.lang.Object
org.eclipse.graphiti.features.impl.AbstractFeature
org.eclipse.graphiti.features.impl.DefaultRemoveFeature
- All Implemented Interfaces:
IFeature
,IFeatureProviderHolder
,IRemoveFeature
,IRemove
,IDescription
,IName
- Direct Known Subclasses:
RemoveFeatureForPattern
The Class DefaultRemoveFeature.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canExecute
(IContext context) Decides if the current feature can execute with the given context.boolean
canRemove
(IRemoveContext context) Checks if given object could be removed.void
Executes the current feature with the given context.Gets the description.getName()
Gets the name.boolean
The Graphiti framework will call this method afterIRemove.preRemove(IRemoveContext)
has been called and before the actual remove is done.void
postRemove
(IRemoveContext context) called after remove call.void
preRemove
(IRemoveContext context) called prior to remove call.void
remove
(IRemoveContext context) Remove the given object.protected void
removeAllConnections
(Anchor anchor) protected void
removeAllConnections
(Shape shape) Removes the all connections.Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature
addGraphicalRepresentation, canUndo, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDiagram, getDiagramBehavior, getFeatureProvider, getProgressCallback, getUserDecision, hasDoneChanges, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, manageDefaultFont, manageFont, manageFont, setProgressCallback, toString, updatePictogramElement
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.graphiti.features.IFeature
canUndo, hasDoneChanges, isAvailable
Methods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder
getFeatureProvider
-
Constructor Details
-
DefaultRemoveFeature
Creates a newDefaultRemoveFeature
.- Parameters:
fp
- the feature provider
-
-
Method Details
-
canRemove
Description copied from interface:IRemove
Checks if given object could be removed. -
remove
Description copied from interface:IRemove
Remove the given object. -
preRemove
Description copied from interface:IRemove
called prior to remove call. -
isRemoveAbort
public boolean isRemoveAbort()Description copied from interface:IRemove
The Graphiti framework will call this method afterIRemove.preRemove(IRemoveContext)
has been called and before the actual remove is done. In case this method returnstrue
, the operation will be cancelled by the Graphiti framework by throwing anOperationCanceledException
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.- Specified by:
isRemoveAbort
in interfaceIRemove
- Returns:
true
in case you want to cancel the current operation,false
otherwise.- Since:
- 0.12
-
removeAllConnections
Removes the all connections.- Parameters:
shape
- the shape
-
removeAllConnections
- Since:
- 0.9
-
postRemove
Description copied from interface:IRemove
called after remove call.- Specified by:
postRemove
in interfaceIRemove
- Parameters:
context
- the context
-
canExecute
Description copied from interface:IFeature
Decides if the current feature can execute with the given context.- Specified by:
canExecute
in interfaceIFeature
- Parameters:
context
- this is the general input for this method- Returns:
- true if the feature can be executed, false if not
- See Also:
-
execute
Description copied from interface:IFeature
Executes the current feature with the given context. -
getName
Description copied from interface:IName
Gets the name.- Specified by:
getName
in interfaceIName
- Overrides:
getName
in classAbstractFeature
- Returns:
- the name
-
getDescription
Description copied from interface:IDescription
Gets the description.- Specified by:
getDescription
in interfaceIDescription
- Overrides:
getDescription
in classAbstractFeature
- Returns:
- the description
-