vocleditor.commands
Class CreateMethodCommand

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

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

Author:
tugstugi Command for creating a method.

Constructor Summary
CreateMethodCommand()
          The default constructor.
 
Method Summary
 void execute()
          Entry point for command execution.
 VOCLModel.Method getMethod()
          Returns the method.
 VOCLModel.ClassifierRole getParent()
          Returns the parent classifier role.
 void redo()
          Redo command execution.
 void setCommandAttributes(java.lang.String name, java.lang.String returnType, VOCLModel.VariableDeclaration returnVariable, java.util.List parameters)
          Sets the command attributes.
 void setMethod(VOCLModel.Method method)
          Sets the method.
 void setName(java.lang.String methodName)
          Sets the name.
 void setParameters(java.util.List parameters)
          Sets the list of parameters.
 void setParent(VOCLModel.ClassifierRole newParent)
          Sets the parent classifier role.
 void setReturnType(java.lang.String returnType)
          Sets the returnType.
 void setReturnVariable(VOCLModel.VariableDeclaration returnVariable)
          Sets the return value.
 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

CreateMethodCommand

public CreateMethodCommand()
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

setMethod

public void setMethod(VOCLModel.Method method)
Sets the method.

Parameters:
method - the methos to set

getMethod

public VOCLModel.Method getMethod()
Returns the method.

Returns:
the method

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

setName

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

Parameters:
methodName - the name to set

setReturnType

public void setReturnType(java.lang.String returnType)
Sets the returnType.

Parameters:
returnType - the return type to set

setReturnVariable

public void setReturnVariable(VOCLModel.VariableDeclaration returnVariable)
Sets the return value.

Parameters:
returnVariable - the return value to set

setParameters

public void setParameters(java.util.List parameters)
Sets the list of parameters.

Parameters:
parameters - the list of the parameters

setCommandAttributes

public void setCommandAttributes(java.lang.String name,
                                 java.lang.String returnType,
                                 VOCLModel.VariableDeclaration returnVariable,
                                 java.util.List parameters)
Sets the command attributes.

Parameters:
name - the method
returnVariable - the return variable
parameters - the parameter list