vocleditor.commands
Class CreateAttributeCommand

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

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

Author:
tugstugi Command for creating an attribute.

Constructor Summary
CreateAttributeCommand()
          The default constructor.
 
Method Summary
 void execute()
          Entry point for command execution.
 VOCLModel.ClassifierRole getParent()
          Returns the parent classifier role.
 void redo()
          Redo command execution.
 void setAttribute(VOCLModel.Attribute attribute)
          Sets the attribute.
 void setCommandAttributes(java.lang.String name, java.lang.String type, java.lang.String value, VOCLModel.VariableDeclaration variable)
          Sets the command attributes.
 void setName(java.lang.String name)
          Sets the attribute name.
 void setParent(VOCLModel.ClassifierRole newParent)
          Sets the parent classifier role.
 void setType(java.lang.String type)
          Sets the attribute type.
 void setValue(java.lang.String value)
          Sets the attribute value.
 void setVariable(VOCLModel.VariableDeclaration variable)
          Sets the attribute variable.
 void undo()
          Undo command execution.
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, 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

CreateAttributeCommand

public CreateAttributeCommand()
The default constructor.

Method Detail

execute

public void execute()
Entry point for command execution.

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

getParent

public VOCLModel.ClassifierRole getParent()
Returns the parent classifier role.

Returns:
the parent classifier role

setParent

public void setParent(VOCLModel.ClassifierRole newParent)
Sets the parent classifier role.

Parameters:
newParent - the parent to set

setAttribute

public void setAttribute(VOCLModel.Attribute attribute)
Sets the attribute.

Parameters:
attribute - the attribute to set

setName

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

Parameters:
name - the attribute name to set

setType

public void setType(java.lang.String type)
Sets the attribute type.

Parameters:
type - the attribute type to set

setValue

public void setValue(java.lang.String value)
Sets the attribute value.

Parameters:
value - the attribute value to set

setVariable

public void setVariable(VOCLModel.VariableDeclaration variable)
Sets the attribute variable.

Parameters:
variable - the attribute variable to set

setCommandAttributes

public void setCommandAttributes(java.lang.String name,
                                 java.lang.String type,
                                 java.lang.String value,
                                 VOCLModel.VariableDeclaration variable)
Sets the command attributes.

Parameters:
name - the attribute name
type - the attribute type
value - the attribute value
variable - the attribute variable