vocleditor.commands
Class CreateAssociationRoleCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by vocleditor.commands.CreateAssociationRoleCommand

public class CreateAssociationRoleCommand
extends org.eclipse.gef.commands.Command

Connects two ClassifierRoles via an AssociationRole.


Constructor Summary
CreateAssociationRoleCommand()
          Constructor for the command class.
 
Method Summary
 boolean canExecute()
          True if the command could be executed, false otherwise.
 void execute()
          Entry point for command execution.
 VOCLModel.AssociationRole getAssociationRole()
          Returns the association role.
 VOCLModel.ClassifierRole getSource()
          Returns the source classifier role.
 VOCLModel.ClassifierRole getTarget()
          Returns the target classifier role.
 void redo()
          Redo command execution.
 void setAssociationRole(VOCLModel.AssociationRole associationRole)
          Sest the association role.
 void setCommandAttributes(VOCLModel.ClassifierRole source, VOCLModel.ClassifierRole target, java.lang.String name)
          Sets the command attributes.
 void setName(java.lang.String name)
          Sets the name of the association role.
 void setSource(VOCLModel.ClassifierRole newSource)
          Sets the source classifier role.
 void setTarget(VOCLModel.ClassifierRole newTarget)
          Sets the target classifier role.
 void undo()
          Undo command execution.
 
Methods inherited from class org.eclipse.gef.commands.Command
canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateAssociationRoleCommand

public CreateAssociationRoleCommand()
Constructor for the command class.

Method Detail

canExecute

public boolean canExecute()
True if the command could be executed, false otherwise.

Overrides:
canExecute in class org.eclipse.gef.commands.Command

execute

public void execute()
Entry point for command execution. Will create a Label and set it.

Overrides:
execute in class org.eclipse.gef.commands.Command

redo

public void redo()
Redo command execution.

Overrides:
redo in class org.eclipse.gef.commands.Command

undo

public void undo()
Undo command execution.

Overrides:
undo in class org.eclipse.gef.commands.Command

getSource

public VOCLModel.ClassifierRole getSource()
Returns the source classifier role.

Returns:
the source classifier role

getAssociationRole

public VOCLModel.AssociationRole getAssociationRole()
Returns the association role.

Returns:
the association role

getTarget

public VOCLModel.ClassifierRole getTarget()
Returns the target classifier role.

Returns:
the target classifier role

setSource

public void setSource(VOCLModel.ClassifierRole newSource)
Sets the source classifier role.

Parameters:
newSource - the source classifier role to set

setTarget

public void setTarget(VOCLModel.ClassifierRole newTarget)
Sets the target classifier role.

Parameters:
newTarget - the target classifier role to set

setAssociationRole

public void setAssociationRole(VOCLModel.AssociationRole associationRole)
Sest the association role.

Parameters:
associationRole - the association role to set

setName

public void setName(java.lang.String name)
Sets the name of the association role.

Parameters:
name - the name of the association role

setCommandAttributes

public void setCommandAttributes(VOCLModel.ClassifierRole source,
                                 VOCLModel.ClassifierRole target,
                                 java.lang.String name)
Sets the command attributes.

Parameters:
source - the source classifier role
target - the target classifier role
name - the name of the association role