pl.edu.agh.cast.command
Class ModifyAttributesCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by pl.edu.agh.cast.command.ModifyAttributesCommand

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

Sets new values in AttributeHolder. Command used in: AttributeEditorDialog

Author:
Pawel Kupinski (pawel.kupinski@gmail.com), awos

Constructor Summary
ModifyAttributesCommand(AttributeValueContainer element, java.util.Collection<AttributeValue> newAttributeValues)
           
 
Method Summary
 boolean canExecute()
          Command can be executed only if: attributes were added or removed attribute values were changed attribute's showAsLabel flag changed Otherwise, command cannot be executed.
 void execute()
           
protected  void fillAttributeHolder(java.util.Collection<AttributeValue> newAttributeValues)
          Changes attributes and it's values in attributesHolder to attributes attached in input newAttributesValues Collection.
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.Command
canUndo, chain, dispose, getDebugLabel, getLabel, redo, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModifyAttributesCommand

public ModifyAttributesCommand(AttributeValueContainer element,
                               java.util.Collection<AttributeValue> newAttributeValues)
Method Detail

canExecute

public boolean canExecute()
Command can be executed only if: Otherwise, command cannot be executed.

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

execute

public void execute()
Overrides:
execute in class org.eclipse.gef.commands.Command

undo

public void undo()
Overrides:
undo in class org.eclipse.gef.commands.Command

fillAttributeHolder

protected void fillAttributeHolder(java.util.Collection<AttributeValue> newAttributeValues)
Changes attributes and it's values in attributesHolder to attributes attached in input newAttributesValues Collection. Also change attributes' isLabel properties.

Parameters:
newAttributeValues - New attributes collection to set in attributesHolder.


Copyright © 2007-2008 AGH University of Science and Technology. All Rights Reserved.