com.pnp.xfeature.commands
Class AddConstraintElementCommand

java.lang.Object
  extended by Command
      extended by com.pnp.xfeature.commands.AddConstraintElementCommand

public class AddConstraintElementCommand
extends Command

The Command class used to add an element to existing global constraint

Author:
Ondrej Rohlik, created on 13.4.2005

Constructor Summary
AddConstraintElementCommand(FeatureDiagramModel diagram, org.w3c.dom.Node parentNode, org.w3c.dom.Node childElement, int constraintType, int constraintPathType)
          Creates command that adds new propery set element to the feature model
 
Method Summary
 void execute()
          calls addConstraintElement() method of the FeatureDiagramModel that adds the new element to DOM model
 void redo()
          calls parentNode.appendChild(element) or insertBefore() method to place the constraint to the right position in its parent
 void undo()
          calls removeChild() method of the FeatureDiagramModel that adds the new element to DOM model
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddConstraintElementCommand

public AddConstraintElementCommand(FeatureDiagramModel diagram,
                                   org.w3c.dom.Node parentNode,
                                   org.w3c.dom.Node childElement,
                                   int constraintType,
                                   int constraintPathType)
Creates command that adds new propery set element to the feature model

Parameters:
diagram - the feature model
node - the parent node
Method Detail

execute

public void execute()
calls addConstraintElement() method of the FeatureDiagramModel that adds the new element to DOM model

See Also:
org.eclipse.gef.commands.Command#execute()

redo

public void redo()
calls parentNode.appendChild(element) or insertBefore() method to place the constraint to the right position in its parent

See Also:
org.eclipse.gef.commands.Command#redo()

undo

public void undo()
calls removeChild() method of the FeatureDiagramModel that adds the new element to DOM model

See Also:
org.eclipse.gef.commands.Command#undo()


Copyright © 2004 - 2008 ETH Zurich and P&P Software GmbH, All Rights Reserved.