vocleditor.commands
Class EditAssociationRoleCommand

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

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

Edit association role properties.


Constructor Summary
EditAssociationRoleCommand()
          The default constructor.
 
Method Summary
 boolean canExecute()
          Checks whether source_new, source_old, target_new and target_old are not null.
 void execute()
          Command execution - Swaps target and source if necessary
 void redo()
          Redo command execution.
 void setAssociationRole(VOCLModel.AssociationRole associationrole)
           
 void setCommandAttributes(VOCLModel.ClassifierRole source, VOCLModel.ClassifierRole target, java.lang.String name, byte routingType)
          Sets the command attributes.
 void setName(java.lang.String name)
          Sets the association role name.
 void setSource(VOCLModel.ClassifierRole source)
          Sets the source classifier role.
 void setTarget(VOCLModel.ClassifierRole target)
          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

EditAssociationRoleCommand

public EditAssociationRoleCommand()
The default constructor.

Method Detail

canExecute

public boolean canExecute()
Checks whether source_new, source_old, target_new and target_old are not null.

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

setAssociationRole

public void setAssociationRole(VOCLModel.AssociationRole associationrole)
Parameters:
associationrole - The AssociationRole to modify.

execute

public void execute()
Command execution - Swaps target and source if necessary

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

undo

public void undo()
Undo command execution.

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

redo

public void redo()
Redo command execution.

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

setSource

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

Parameters:
source - the source classifier role to set

setTarget

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

Parameters:
target - the target classifier role to set

setName

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

Parameters:
name - the association role name

setCommandAttributes

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

Parameters:
source - the source classifier role
target - the target classifier role
name - the association role name
routingType - the routing type