Class AbstractCreateConnectionFeature

java.lang.Object
org.eclipse.graphiti.features.impl.AbstractFeature
org.eclipse.graphiti.features.impl.AbstractCreateConnectionFeature
All Implemented Interfaces:
ICreateConnectionFeature, IFeature, IFeatureProviderHolder, ICreateConnection, ICreateInfo, IDescription, IName
Direct Known Subclasses:
CreateConnectionFeatureForPattern

public abstract class AbstractCreateConnectionFeature extends AbstractFeature implements ICreateConnectionFeature
The Class AbstractCreateConnectionFeature.
  • Constructor Details

  • Method Details

    • getCreateDescription

      public String getCreateDescription()
      Gets the create description.
      Specified by:
      getCreateDescription in interface ICreateInfo
      Returns:
      Returns the description.
    • getCreateName

      public String getCreateName()
      Gets the create name.
      Specified by:
      getCreateName in interface ICreateInfo
      Returns:
      Returns the name.
    • 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:
    • getCreateImageId

      public String getCreateImageId()
      Description copied from interface: ICreateInfo
      Gets the create image id.
      Specified by:
      getCreateImageId in interface ICreateInfo
      Returns:
      image for UI representation
    • getCreateLargeImageId

      public String getCreateLargeImageId()
      Description copied from interface: ICreateInfo
      Gets the create large image id.
      Specified by:
      getCreateLargeImageId in interface ICreateInfo
      Returns:
      large image for UI representation
    • 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
    • startConnecting

      public void startConnecting()
      Description copied from interface: ICreateConnection
      Will called after a connection creation tool from the palette was selected.
      Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction. In case you want to modify the model (EMF domain objects or Graphiti pictogram objects) you need to do that within a command executed on the editor's command stack to make sure that the modification happens inside an EMF write transaction. Keep in mind that any changes you do within such a command will be create a seperate entry in the undo/redo stack for the editor, which might not be the desired effect.
      Specified by:
      startConnecting in interface ICreateConnection
      Since:
      0.9
    • endConnecting

      public void endConnecting()
      Description copied from interface: ICreateConnection
      Will called after a connection creation tool from the palette was deselected.
      Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction. In case you want to modify the model (EMF domain objects or Graphiti pictogram objects) you need to do that within a command executed on the editor's command stack to make sure that the modification happens inside an EMF write transaction. Keep in mind that any changes you do within such a command will be create a seperate entry in the undo/redo stack for the editor, which might not be the desired effect.
      Specified by:
      endConnecting in interface ICreateConnection
      Since:
      0.9
    • attachedToSource

      public void attachedToSource(ICreateConnectionContext context)
      Description copied from interface: ICreateConnection
      Will called after a connection was successfully attached to an anchor of a source object.
      Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction. In case you want to modify the model (EMF domain objects or Graphiti pictogram objects) you need to do that within a command executed on the editor's command stack to make sure that the modification happens inside an EMF write transaction. Keep in mind that any changes you do within such a command will be create a seperate entry in the undo/redo stack for the editor, which might not be the desired effect.
      Specified by:
      attachedToSource in interface ICreateConnection
      Parameters:
      context - the context
      Since:
      0.9
    • canceledAttaching

      public void canceledAttaching(ICreateConnectionContext context)
      Description copied from interface: ICreateConnection
      Will called if the connection creation process was canceled after the successful attachment of the connection to an anchor of a source object. E.g. user pressed ESC, user clicked on an invalid target, focus was lost, ...
      Note: In contrast to the standard feature methods like ICreateConnection.canCreate(ICreateConnectionContext) and ICreateConnection.create(ICreateConnectionContext) this method will not be called in the scope of an EMF transaction. In case you want to modify the model (EMF domain objects or Graphiti pictogram objects) you need to do that within a command executed on the editor's command stack to make sure that the modification happens inside an EMF write transaction. Keep in mind that any changes you do within such a command will be create a seperate entry in the undo/redo stack for the editor, which might not be the desired effect.
      Specified by:
      canceledAttaching in interface ICreateConnection
      Parameters:
      context - the context
      Since:
      0.9