Package org.eclipse.graphiti.func

# Interface ICreateConnection

All Superinterfaces:
  `ICreateInfo`

All Known Subinterfaces:
  `IConnectionPattern`, `ICreateConnectionFeature`

All Known Implementing Classes:
  `AbstractConnectionPattern`, `AbstractCreateConnectionFeature`, `CreateConnectionFeatureForPattern`

public interface ICreateConnection extends ICreateInfo
The Interface ICreateConnection.

## Method Summary

Modifier and Type
Method
Description
`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 `canCreate(ICreateConnectionContext)` and `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`
`canCreate(ICreateConnectionContext context)`
Can create.
`boolean`
`canStartConnection(ICreateConnectionContext context)`
Can start connection.
`Connection`
`create(ICreateConnectionContext context)`
Creates the connection.
`void`
`endConnecting()`
Will called after a connection creation tool from the palette was deselected.
Note: In contrast to the standard feature methods like `canCreate(ICreateConnectionContext)` and `create(ICreateConnectionContext)` this method will not be called in the scope of an EMF transaction.
`void`
`startConnecting()`
Will called after a connection creation tool from the palette was selected.
Note: In contrast to the standard feature methods like `canCreate(ICreateConnectionContext)` and `create(ICreateConnectionContext)` this method will not be called in the scope of an EMF transaction.

### Methods inherited from interface org.eclipse.graphiti.func.ICreateInfo

`getCreateDescription, getCreateImageId, getCreateLargeImageId, getCreateName`

## Method Details

### canCreate

boolean canCreate(ICreateConnectionContext context)
Can create.

Parameters:
  `context` - the context
Returns:
  true, if successful

### create

Connection create(ICreateConnectionContext context)
Creates the connection.

Parameters:
  `context` - the context
Returns:
  The connection that has been created or `null` in case no valid connection can be returned. Currently this return value is not evaluated by the Graphiti framework but it might be used in future versions but only for performance optimizations.

### canStartConnection

boolean canStartConnection(ICreateConnectionContext context)
Can start connection.

Parameters:
  `context` - the context
Returns:
  true, if successful

### startConnecting

void startConnecting()
Will called after a connection creation tool from the palette was selected.
Note: In contrast to the standard feature methods like `canCreate(ICreateConnectionContext)` and `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.

Since:
  0.9

### endConnecting

void endConnecting()
Will called after a connection creation tool from the palette was deselected.
Note: In contrast to the standard feature methods like `canCreate(ICreateConnectionContext)` and `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.

Since:
  0.9

### attachedToSource

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 `canCreate(ICreateConnectionContext)` and `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.

Parameters:
  `context` - the context
Since:
  0.9

### canceledAttaching

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. E.g. user pressed ESC, user clicked on an invalid target, focus was lost, ...
Note: In contrast to the standard feature methods like `canCreate(ICreateConnectionContext)` and `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.

Parameters:
  `context` - the context
Since:
  0.9