Package org.eclipse.graphiti.features.impl

## 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 Summary

Constructors
`AbstractCreateConnectionFeature​(IFeatureProvider fp, java.lang.String name, java.lang.String description)` Creates a new `AbstractAddShapeFeature`.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `attachedToSource​(ICreateConnectionContext context)` 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.
`void` `canceledAttaching​(ICreateConnectionContext context)` Will called if the connection creation process was canceled after the successful attachment of the connection to an anchor of a source object.
`boolean` `canExecute​(IContext context)` Decides if the current feature can execute with the given context.
`void` `endConnecting()` 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.
`void` `execute​(IContext context)` Executes the current feature with the given context.
`java.lang.String` `getCreateDescription()` Gets the create description.
`java.lang.String` `getCreateImageId()` Gets the create image id.
`java.lang.String` `getCreateLargeImageId()` Gets the create large image id.
`java.lang.String` `getCreateName()` Gets the create name.
`java.lang.String` `getName()` Gets the name.
`void` `startConnecting()` 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.

### Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature

`addGraphicalRepresentation, canUndo, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDescription, 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.func.ICreateConnection

`canCreate, canStartConnection, create`

### Methods inherited from interface org.eclipse.graphiti.IDescription

`getDescription`

### Methods inherited from interface org.eclipse.graphiti.features.IFeature

`canUndo, hasDoneChanges, isAvailable`

### Methods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder

`getFeatureProvider`

### Constructor Detail

#### AbstractCreateConnectionFeature

    public AbstractCreateConnectionFeature​(IFeatureProvider fp,
                                           java.lang.String name,
                                           java.lang.String description)

Creates a new `AbstractAddShapeFeature`.

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