vocleditor.commands
Class CreateConditionCommand

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

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

Author:
manaljav Command for creating a condition.

Constructor Summary
CreateConditionCommand()
          The default constructor.
 
Method Summary
 void execute()
          Entry point for command execution.
 VOCLModel.NavExp getParent()
          Returns the parent constraint.
 void redo()
          Redo command execution.
 void setCommandAttributes(java.lang.String op, java.lang.String value, VOCLModel.VariableDeclaration left, VOCLModel.VariableDeclaration right, boolean leftPre, boolean rightPre)
          Sets the attributes.
 void setCondition(VOCLModel.Condition condition)
          Sets the condition.
 void setLeft(VOCLModel.VariableDeclaration left)
          Sets the left variable.
 void setLeftPre(boolean leftPre)
          Sets the left pre.
 void setOp(java.lang.String op)
          Sets the operation.
 void setParent(VOCLModel.NavExp newParent)
          Sets the parent constraint.
 void setRight(VOCLModel.VariableDeclaration right)
          Sets the right variable.
 void setRightPre(boolean rightPre)
          Sets the rigth pre.
 void setValue(java.lang.String value)
          Sets the 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

CreateConditionCommand

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

setCondition

public void setCondition(VOCLModel.Condition condition)
Sets the condition.

Parameters:
condition - the condition to set

getParent

public VOCLModel.NavExp getParent()
Returns the parent constraint.

Returns:
the parent constraint

setParent

public void setParent(VOCLModel.NavExp newParent)
Sets the parent constraint.

Parameters:
newParent - the parent to set

setOp

public void setOp(java.lang.String op)
Sets the operation.

Parameters:
op - the op to set

setValue

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

Parameters:
value - the value to set

setRight

public void setRight(VOCLModel.VariableDeclaration right)
Sets the right variable.

Parameters:
right - the right variable to set

setLeft

public void setLeft(VOCLModel.VariableDeclaration left)
Sets the left variable.

Parameters:
left - the left variable to set

setLeftPre

public void setLeftPre(boolean leftPre)
Sets the left pre.

Parameters:
leftPre - the left pre

setRightPre

public void setRightPre(boolean rightPre)
Sets the rigth pre.

Parameters:
rightPre - the right pre

setCommandAttributes

public void setCommandAttributes(java.lang.String op,
                                 java.lang.String value,
                                 VOCLModel.VariableDeclaration left,
                                 VOCLModel.VariableDeclaration right,
                                 boolean leftPre,
                                 boolean rightPre)
Sets the attributes.

Parameters:
op - the operation
value - the value
left - the left variable
right - the right variable