public class CreateConnectionFeatureForPattern extends AbstractCreateConnectionFeature implements ICustomAbortableUndoRedoFeature
| Constructor and Description |
|---|
CreateConnectionFeatureForPattern(IFeatureProvider featureProvider,
IConnectionPattern pattern)
Creates a new
CreateConnectionFeatureForPattern. |
| Modifier and Type | Method and 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 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 |
canCreate(ICreateConnectionContext context)
Can create.
|
boolean |
canRedo(IContext context)
Decides if the processed feature can be re-done.
|
boolean |
canStartConnection(ICreateConnectionContext context)
Can start connection.
|
boolean |
canUndo(IContext context)
Decides if the current feature can be undone - this is the undo of the
execute operation.
|
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 ICreateConnection.canCreate(ICreateConnectionContext) and
ICreateConnection.create(ICreateConnectionContext) this method will not be called
in the scope of an EMF transaction. |
java.lang.String |
getCreateImageId()
Gets the create image id.
|
java.lang.String |
getCreateLargeImageId()
Gets the create large image id.
|
IConnectionPattern |
getPattern()
Gets the pattern.
|
boolean |
isAbort()
The Graphiti framework will call this method after
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext) have
been called and before the actual undo/redo operation is triggered. |
void |
postRedo(IContext context)
This method will be called by the Graphiti framework after the EMF undo
has finished.
|
void |
postUndo(IContext context)
This method will be called by the Graphiti framework after the EMF undo
is finished.
|
void |
preRedo(IContext context)
This method will be called by the Graphiti framework before the EMF undo
has triggered.
|
void |
preUndo(IContext context)
This method will be called by the Graphiti framework before the EMF undo
is triggered.
|
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. |
canExecute, execute, getCreateDescription, getCreateName, getNamegetDescription, getFeatureProvider, hasDoneChanges, isAvailable, manageFont, manageFont, setProgressCallback, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waithasDoneChanges, isAvailablegetDescriptiongetFeatureProviderpublic CreateConnectionFeatureForPattern(IFeatureProvider featureProvider, IConnectionPattern pattern)
CreateConnectionFeatureForPattern.featureProvider - the feature providerpattern - the connection patternpublic boolean canCreate(ICreateConnectionContext context)
ICreateConnectioncanCreate in interface ICreateConnectioncontext - the contextpublic boolean canStartConnection(ICreateConnectionContext context)
ICreateConnectioncanStartConnection in interface ICreateConnectioncontext - the contextpublic Connection create(ICreateConnectionContext context)
ICreateConnectioncreate in interface ICreateConnectioncontext - the contextnull 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.public java.lang.String getCreateImageId()
ICreateInfogetCreateImageId in interface ICreateInfogetCreateImageId in class AbstractCreateConnectionFeaturepublic java.lang.String getCreateLargeImageId()
ICreateInfogetCreateLargeImageId in interface ICreateInfogetCreateLargeImageId in class AbstractCreateConnectionFeaturepublic boolean isAbort()
ICustomAbortableUndoRedoFeatureICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext) have
been called and before the actual undo/redo operation is triggered. In
case this method returns true, the operation will be
cancelled by the Graphiti framework by throwing an
OperationCanceledException that causes am EMF revert of the
operation.
Implementing classes might e.g. set a flag in
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext) as
cancellation indication and check that that flag here.
isAbort in interface ICustomAbortableUndoRedoFeaturetrue in case you want to cancel the current
operation, false otherwise.public boolean canUndo(IContext context)
IFeaturecanUndo in interface ICustomUndoRedoFeaturecanUndo in interface IFeaturecanUndo in class AbstractFeaturecontext - this is the general input for this methodIContextpublic void preUndo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.postUndo(IContext).preUndo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void postUndo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.preUndo(IContext).postUndo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic boolean canRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.preRedo(IContext).
Note that as soon as any feature reports false here, also
all consecutive entries in the command stack are no longer reachable for
redo.
canRedo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void preRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.postRedo(IContext). (Usually it might be
sufficient to delegate to the execution method of the feature.)preRedo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void postRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.preRedo(IContext). (Usually it might be
sufficient to delegate to the execution method of the feature.)postRedo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void startConnecting()
ICreateConnectionICreateConnection.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.startConnecting in interface ICreateConnectionstartConnecting in class AbstractCreateConnectionFeaturepublic void endConnecting()
ICreateConnectionICreateConnection.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.endConnecting in interface ICreateConnectionendConnecting in class AbstractCreateConnectionFeaturepublic void attachedToSource(ICreateConnectionContext context)
ICreateConnectionICreateConnection.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.attachedToSource in interface ICreateConnectionattachedToSource in class AbstractCreateConnectionFeaturecontext - the contextpublic void canceledAttaching(ICreateConnectionContext context)
ICreateConnectionICreateConnection.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.canceledAttaching in interface ICreateConnectioncanceledAttaching in class AbstractCreateConnectionFeaturecontext - the contextpublic IConnectionPattern getPattern()