Package org.csstudio.opibuilder.commands
Class ConnectionCreateCommand
java.lang.Object
org.eclipse.gef.commands.Command
org.csstudio.opibuilder.commands.ConnectionCreateCommand
public class ConnectionCreateCommand
extends org.eclipse.gef.commands.Command
A command to create a connection between two widgets.
-
Constructor Summary
ConstructorDescriptionConnectionCreateCommand
(AbstractWidgetModel source, String sourceTerminal) Instantiate a command that can create a connection between two widgets. -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
execute()
void
redo()
void
setTarget
(AbstractWidgetModel target) Set the target for the connection.void
setTargetTerminal
(String targetTerminal) void
undo()
Methods inherited from class org.eclipse.gef.commands.Command
canRedo, canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
-
Constructor Details
-
ConnectionCreateCommand
Instantiate a command that can create a connection between two widgets.- Parameters:
source
- the source endpointsourceTerminal
- terminal on the source- Throws:
IllegalArgumentException
- if source is null
-
-
Method Details
-
canExecute
public boolean canExecute()- Overrides:
canExecute
in classorg.eclipse.gef.commands.Command
-
execute
public void execute()- Overrides:
execute
in classorg.eclipse.gef.commands.Command
-
redo
public void redo()- Overrides:
redo
in classorg.eclipse.gef.commands.Command
-
setTarget
Set the target for the connection.- Parameters:
target
- that target- Throws:
IllegalArgumentException
- if target is null
-
setTargetTerminal
-
undo
public void undo()- Overrides:
undo
in classorg.eclipse.gef.commands.Command
-