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
ConstructorDescriptionAbstractCreateConnectionFeature
(IFeatureProvider fp, String name, String description) Creates a newAbstractAddShapeFeature
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 likeICreateConnection.canCreate(ICreateConnectionContext)
andICreateConnection.create(ICreateConnectionContext)
this method will not be called in the scope of an EMF transaction.void
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
Will called after a connection creation tool from the palette was deselected.
Note: In contrast to the standard feature methods likeICreateConnection.canCreate(ICreateConnectionContext)
andICreateConnection.create(ICreateConnectionContext)
this method will not be called in the scope of an EMF transaction.void
Executes the current feature with the given context.Gets the create description.Gets the create image id.Gets the create large image id.Gets the create name.getName()
Gets the name.void
Will called after a connection creation tool from the palette was selected.
Note: In contrast to the standard feature methods likeICreateConnection.canCreate(ICreateConnectionContext)
andICreateConnection.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 Details
-
AbstractCreateConnectionFeature
Creates a newAbstractAddShapeFeature
.- Parameters:
fp
- the fpname
- the namedescription
- the description
-
-
Method Details
-
getCreateDescription
Gets the create description.- Specified by:
getCreateDescription
in interfaceICreateInfo
- Returns:
- Returns the description.
-
getCreateName
Gets the create name.- Specified by:
getCreateName
in interfaceICreateInfo
- Returns:
- Returns the name.
-
canExecute
Description copied from interface:IFeature
Decides if the current feature can execute with the given context.- Specified by:
canExecute
in interfaceIFeature
- Parameters:
context
- this is the general input for this method- Returns:
- true if the feature can be executed, false if not
- See Also:
-
execute
Description copied from interface:IFeature
Executes the current feature with the given context. -
getCreateImageId
Description copied from interface:ICreateInfo
Gets the create image id.- Specified by:
getCreateImageId
in interfaceICreateInfo
- Returns:
- image for UI representation
-
getCreateLargeImageId
Description copied from interface:ICreateInfo
Gets the create large image id.- Specified by:
getCreateLargeImageId
in interfaceICreateInfo
- Returns:
- large image for UI representation
-
getName
Description copied from interface:IName
Gets the name.- Specified by:
getName
in interfaceIName
- Overrides:
getName
in classAbstractFeature
- 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 likeICreateConnection.canCreate(ICreateConnectionContext)
andICreateConnection.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 interfaceICreateConnection
- 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 likeICreateConnection.canCreate(ICreateConnectionContext)
andICreateConnection.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 interfaceICreateConnection
- Since:
- 0.9
-
attachedToSource
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 likeICreateConnection.canCreate(ICreateConnectionContext)
andICreateConnection.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 interfaceICreateConnection
- Parameters:
context
- the context- Since:
- 0.9
-
canceledAttaching
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 likeICreateConnection.canCreate(ICreateConnectionContext)
andICreateConnection.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 interfaceICreateConnection
- Parameters:
context
- the context- Since:
- 0.9
-