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 Details

  • Method Details

    • canRemove

      public boolean canRemove(IRemoveContext context)
      Description copied from interface: IRemove
      Checks if given object could be removed.
      Specified by:
      canRemove in interface IRemove
      Parameters:
      context - contains object to remove
      Returns:
      true if remove is possible
    • remove

      public void remove(IRemoveContext context)
      Description copied from interface: IRemove
      Remove the given object.
      Specified by:
      remove in interface IRemove
      Parameters:
      context - contains object to remove
    • preRemove

      public void preRemove(IRemoveContext context)
      Description copied from interface: IRemove
      called prior to remove call.
      Specified by:
      preRemove in interface IRemove
      Parameters:
      context - the context
    • isRemoveAbort

      public boolean isRemoveAbort()
      Description copied from interface: IRemove
      The Graphiti framework will call this method after 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.

      Specified by:
      isRemoveAbort in interface IRemove
      Returns:
      true in case you want to cancel the current operation, false otherwise.
      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: IRemove
      called after remove call.
      Specified by:
      postRemove in interface IRemove
      Parameters:
      context - the context
    • canExecute

      public boolean canExecute(IContext context)
      Description copied from interface: IFeature
      Decides if the current feature can execute with the given context.
      Specified by:
      canExecute in interface IFeature
      Parameters:
      context - this is the general input for this method
      Returns:
      true if the feature can be executed, false if not
      See Also:
    • execute

      public void execute(IContext context)
      Description copied from interface: IFeature
      Executes the current feature with the given context.
      Specified by:
      execute in interface IFeature
      Parameters:
      context - this is the general input for this method
      See Also:
    • getName

      public String getName()
      Description copied from interface: IName
      Gets the name.
      Specified by:
      getName in interface IName
      Overrides:
      getName in class AbstractFeature
      Returns:
      the name
    • getDescription

      public String getDescription()
      Description copied from interface: IDescription
      Gets the description.
      Specified by:
      getDescription in interface IDescription
      Overrides:
      getDescription in class AbstractFeature
      Returns:
      the description