Class AbstractCreateConnectionFeature

    • Constructor Detail

      • AbstractCreateConnectionFeature

        public AbstractCreateConnectionFeature​(IFeatureProvider fp,
                                               java.lang.String name,
                                               java.lang.String description)
        Parameters:
        fp - the fp
        name - the name
        description - the description
    • Method Detail

      • getCreateDescription

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

        public java.lang.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:
        IContext
      • 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:
        IContext
      • getCreateImageId

        public java.lang.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 java.lang.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 java.lang.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