Class CreateConnectionCommand
java.lang.Object
org.eclipse.gef.commands.Command
org.eclipse.graphiti.ui.internal.command.AbstractCommand
org.eclipse.graphiti.ui.internal.command.CreateConnectionCommand
- All Implemented Interfaces:
IConfigurationProviderHolder
-
Constructor Summary
ConstructorsConstructorDescriptionCreateConnectionCommand(IConfigurationProvider configurationProvider, PictogramElement pe, List<IFeature> features) Instantiate a command that can create a connection between two anchors. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleancanUndo()voidvoidvoidexecute()voidredo()voidsetLocation(org.eclipse.draw2d.geometry.Point location) sets the location for the command when connection is dropped into nowherevoidSet the target endpoint for the connection.voidundo()Methods inherited from class org.eclipse.graphiti.ui.internal.command.AbstractCommand
getConfigurationProvider, getFeatureProvider, getTransactionalEditingDomainMethods inherited from class org.eclipse.gef.commands.Command
canRedo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
-
Constructor Details
-
CreateConnectionCommand
public CreateConnectionCommand(IConfigurationProvider configurationProvider, PictogramElement pe, List<IFeature> features) Instantiate a command that can create a connection between two anchors.- Parameters:
source- the source endpoint (a non-null Shape instance)lineStyle- the desired line style. See Connection#setLineStyle(int) for details- Throws:
IllegalArgumentException- if source is null- See Also:
-
Connection#setLineStyle(int)
-
-
Method Details
-
canExecute
public boolean canExecute()- Overrides:
canExecutein classorg.eclipse.gef.commands.Command
-
execute
public void execute()- Overrides:
executein classorg.eclipse.gef.commands.Command
-
canStartConnection
public boolean canStartConnection() -
redo
public void redo()- Overrides:
redoin classorg.eclipse.gef.commands.Command
-
setTarget
Set the target endpoint for the connection.- Parameters:
target- that target endpoint (a non-null Shape instance)- Throws:
IllegalArgumentException- if target is null
-
canUndo
public boolean canUndo()- Overrides:
canUndoin classorg.eclipse.gef.commands.Command
-
undo
public void undo()- Overrides:
undoin classorg.eclipse.gef.commands.Command
-
getSourceObject
-
setLocation
public void setLocation(org.eclipse.draw2d.geometry.Point location) sets the location for the command when connection is dropped into nowhere- Parameters:
location-
-
getFeaturesAndContexts
-
connectionStarted
public void connectionStarted() -
deactivate
public void deactivate()
-