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
public class DefaultRemoveFeature extends AbstractFeature implements IRemoveFeature
The Class DefaultRemoveFeature.
-
-
Constructor Summary
Constructors Constructor Description DefaultRemoveFeature(IFeatureProvider fp)Creates a newDefaultRemoveFeature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExecute(IContext context)Decides if the current feature can execute with the given context.booleancanRemove(IRemoveContext context)Checks if given object could be removed.voidexecute(IContext context)Executes the current feature with the given context.java.lang.StringgetDescription()Gets the description.java.lang.StringgetName()Gets the name.booleanisRemoveAbort()The Graphiti framework will call this method afterIRemove.preRemove(IRemoveContext)has been called and before the actual remove is done.voidpostRemove(IRemoveContext context)called after remove call.voidpreRemove(IRemoveContext context)called prior to remove call.voidremove(IRemoveContext context)Remove the given object.protected voidremoveAllConnections(Anchor anchor)protected voidremoveAllConnections(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 Detail
-
DefaultRemoveFeature
public DefaultRemoveFeature(IFeatureProvider fp)
Creates a newDefaultRemoveFeature.- Parameters:
fp- the feature provider
-
-
Method Detail
-
canRemove
public boolean canRemove(IRemoveContext context)
Description copied from interface:IRemoveChecks if given object could be removed.
-
remove
public void remove(IRemoveContext context)
Description copied from interface:IRemoveRemove the given object.
-
preRemove
public void preRemove(IRemoveContext context)
Description copied from interface:IRemovecalled prior to remove call.
-
isRemoveAbort
public boolean isRemoveAbort()
Description copied from interface:IRemoveThe 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 anOperationCanceledExceptionthat 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:
isRemoveAbortin interfaceIRemove- Returns:
truein case you want to cancel the current operation,falseotherwise.- Since:
- 0.12
-
removeAllConnections
protected void removeAllConnections(Shape shape)
Removes the all connections.- Parameters:
shape- the shape
-
removeAllConnections
protected void removeAllConnections(Anchor anchor)
- Since:
- 0.9
-
postRemove
public void postRemove(IRemoveContext context)
Description copied from interface:IRemovecalled after remove call.- Specified by:
postRemovein interfaceIRemove- Parameters:
context- the context
-
canExecute
public boolean canExecute(IContext context)
Description copied from interface:IFeatureDecides if the current feature can execute with the given context.- Specified by:
canExecutein interfaceIFeature- Parameters:
context- this is the general input for this method- Returns:
- true if the feature can be executed, false if not
- See Also:
IContext
-
execute
public void execute(IContext context)
Description copied from interface:IFeatureExecutes the current feature with the given context.
-
getName
public java.lang.String getName()
Description copied from interface:INameGets the name.- Specified by:
getNamein interfaceIName- Overrides:
getNamein classAbstractFeature- Returns:
- the name
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IDescriptionGets the description.- Specified by:
getDescriptionin interfaceIDescription- Overrides:
getDescriptionin classAbstractFeature- Returns:
- the description
-
-