org.pietschy.command
Class CompoundCommand

java.lang.Object
  extended by org.pietschy.command.Command
      extended by org.pietschy.command.ActionCommand
          extended by org.pietschy.command.CompoundCommand
All Implemented Interfaces:
ActionCommandExecutor

public class CompoundCommand
extends ActionCommand

An ActionCommand that executes a number of sub-commands. Commands are executed in the order they were added.

See Also:
addCommand(org.pietschy.command.ActionCommand), removeCommand(org.pietschy.command.ActionCommand)

Field Summary
 
Fields inherited from class org.pietschy.command.ActionCommand
HINT_ACTION_EVENT, HINT_INVOKER, HINT_INVOKER_WINDOW, HINT_MODIFIERS
 
Fields inherited from class org.pietschy.command.Command
internalLog, listenerList, pcs
 
Constructor Summary
CompoundCommand()
          Creates a new anonymous CompoundCommand.
CompoundCommand(CommandManager commandManager, java.lang.String commandId)
           
CompoundCommand(java.lang.String commandId)
          Creates a new command with the specified Id.
 
Method Summary
 void addCommand(ActionCommand cmd)
          Adds an ActionCommand to the end of the command list.
 void handleExecute()
          Executes all the sub commands.
 void removeCommand(ActionCommand cmd)
          Removes the ActionCommand from the the command list.
 
Methods inherited from class org.pietschy.command.ActionCommand
addCommandListener, addInterceptor, areEqual, attach, configureButtonStates, detach, execute, execute, getActionAdapter, getActionAdapter, getActionCommand, getActionEvent, getHint, getHint, getHints, getInvoker, getInvokerWindow, getModifiers, installShortCut, installShortCut, postExecute, preExecute, putHint, putHints, removeCommandListener, removeInterceptor, requestDefautIn, setActionCommand, uninstallShortCut, uninstallShortCut
 
Methods inherited from class org.pietschy.command.Command
addFace, addHoverListener, addNewFace, addNotify, addPropertyChangeListener, addPropertyChangeListener, buttonIterator, configureButtonAppearance, configureButtonAppearances, configureButtonAppearances, createButton, createButton, createButton, createButton, createMenuItem, createMenuItem, createMenuItem, createMenuItem, export, faceExists, fireHoverEnded, fireHoverStarted, getAccelerator, getAlternativeFaceNames, getButtonFactory, getButtonIn, getCommandManager, getDefaultFace, getDefaultFace, getDescription, getFace, getFace, getIcon, getId, getLongDescription, getMenuFactory, getMnemonic, getMnemonicIndex, getProperty, getProperty, getPropertyNames, getSelectedIcon, getText, getTextPosition, getToolbarFactory, initCommandManager, installFace, isAnonymous, isAttachedTo, isEnabled, isVisible, putProperty, removeHoverListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, requestFocusIn, setAccelerator, setButtonFactory, setDescription, setEnabled, setIcon, setLongDescription, setMenuFactory, setMnemonic, setMnemonicIndex, setSelectedIcon, setText, setTextPosition, setToolbarFactory, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.pietschy.command.ActionCommandExecutor
addPropertyChangeListener, addPropertyChangeListener, isEnabled, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

CompoundCommand

public CompoundCommand(CommandManager commandManager,
                       java.lang.String commandId)

CompoundCommand

public CompoundCommand(java.lang.String commandId)
Creates a new command with the specified Id.

Parameters:
commandId -

CompoundCommand

public CompoundCommand()
Creates a new anonymous CompoundCommand. Anonymous commands must be fully programatically created and can't be added a CommandManager.

See Also:
ActionCommand
Method Detail

handleExecute

public void handleExecute()
Executes all the sub commands. The command are executed in the order of addition.

Specified by:
handleExecute in class ActionCommand

addCommand

public void addCommand(ActionCommand cmd)
Adds an ActionCommand to the end of the command list.

Parameters:
cmd - the command to installFace.

removeCommand

public void removeCommand(ActionCommand cmd)
Removes the ActionCommand from the the command list.

Parameters:
cmd - the command to remove.