Modelers

org.topcased.modeler.commands
Class CompoundCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by org.eclipse.gef.commands.CompoundCommand
          extended by org.topcased.modeler.commands.CompoundCommand
Direct Known Subclasses:
DeleteModelCommand

public class CompoundCommand
extends org.eclipse.gef.commands.CompoundCommand

This command just act like the GEF CompoundCommand. The difference is that you can add already executed command, so they will not be executed a second time.

See Also:
CompoundCommand

Constructor Summary
CompoundCommand()
          Empty constructor
CompoundCommand(java.lang.String label)
          Empty constructor
 
Method Summary
 void add(org.eclipse.gef.commands.Command command)
           
 void addExecuted(org.eclipse.gef.commands.Command command)
          Add an already executed command to the list of commands
 boolean canExecute()
           
 void execute()
          Only execute commands that were not executed yet
 
Methods inherited from class org.eclipse.gef.commands.CompoundCommand
canUndo, dispose, getChildren, getCommands, getLabel, isEmpty, redo, size, undo, unwrap
 
Methods inherited from class org.eclipse.gef.commands.Command
chain, getDebugLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundCommand

public CompoundCommand()
Empty constructor


CompoundCommand

public CompoundCommand(java.lang.String label)
Empty constructor

Parameters:
label - Command label
Method Detail

add

public void add(org.eclipse.gef.commands.Command command)
Overrides:
add in class org.eclipse.gef.commands.CompoundCommand
See Also:
CompoundCommand.add(org.eclipse.gef.commands.Command)

addExecuted

public void addExecuted(org.eclipse.gef.commands.Command command)
Add an already executed command to the list of commands

Parameters:
command - the executed command

canExecute

public boolean canExecute()
Overrides:
canExecute in class org.eclipse.gef.commands.CompoundCommand
See Also:
CompoundCommand.canExecute()

execute

public void execute()
Only execute commands that were not executed yet

Overrides:
execute in class org.eclipse.gef.commands.CompoundCommand
See Also:
CompoundCommand.execute()

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.