org.pietschy.command

Class CompoundCommand

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(ActionCommand), removeCommand(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(String commandId)
Creates a new command with the specified Id.
CompoundCommand(CommandManager commandManager, String commandId)
Constructs a new Command object 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, handleExecute, 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, attach, buttonIterator, configureButtonAppearance, configureButtonAppearances, configureButtonAppearances, configureButtonStates, createButton, createButton, createButton, createButton, createMenuItem, createMenuItem, createMenuItem, createMenuItem, detach, 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

Constructor Details

CompoundCommand

public CompoundCommand()
See Also:
ActionCommand

CompoundCommand

public CompoundCommand(String commandId)
Creates a new command with the specified Id.
Parameters:
commandId -

CompoundCommand

public CompoundCommand(CommandManager commandManager,
                       String commandId)
Constructs a new Command object with the specified Id.
Parameters:
commandManager -

Method Details

addCommand

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

handleExecute

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

removeCommand

public void removeCommand(ActionCommand cmd)
Removes the ActionCommand from the the command list.
Parameters:
cmd - the command to remove.