|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.esa.beam.framework.ui.command.DefaultCommandManager
public class DefaultCommandManager
The DefaultCommandManager provides a default implementation for the CommandManager
interface.
It also provides a simple mechanism to configure Command items with the key/value pairs stored in a
resource bundle.
Command,
ResourceBundle| Constructor Summary | |
|---|---|
DefaultCommandManager()
|
|
| Method Summary | |
|---|---|
void |
addCommand(Command command)
Adds a new command to this command manager. |
CommandGroup |
createCommandGroup(String commandGroupID,
CommandStateListener listener)
Creates a new command group command for the given unique command ID an the given command state listener. |
ExecCommand |
createExecCommand(String commandID,
CommandListener listener)
Creates a new executable command for the given unique command ID and the given command listener. |
ToolCommand |
createToolCommand(String commandID,
CommandStateListener listener,
com.bc.ceres.swing.figure.Interactor tool)
Creates a new tool command for the given unique command ID an the given tool. |
Command |
getCommand(String commandID)
Gets the command associated with the given command-COMMAND_ID or null if a command with the given command-ID
has not been registered (so far). |
Command |
getCommandAt(int index)
Returns the element at the specified position in this DefaultCommandManager. |
CommandGroup |
getCommandGroup(String commandID)
Gets the command group associated with the given command-ID or null if an command group with the
given command-ID has not been registered. |
ExecCommand |
getExecCommand(String commandID)
Gets the command associated with the given command-ID or null if an command with the given
command-ID has not been registered. |
int |
getNumCommands()
Returns the number of commands in this DefaultCommandManager. |
ToolCommand |
getToolCommand(String commandID)
Gets the tool command associated with the given command-ID or null if a tool command with the given
command-ID has not been registered. |
void |
removeCommand(Command command)
Removes an existing command from this command manager. |
void |
updateComponentTreeUI()
Updates the component tree of all commands since the Java look-and-feel has changed. |
void |
updateState()
Calls the updateState method of all registered commands. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultCommandManager()
| Method Detail |
|---|
public ExecCommand createExecCommand(String commandID,
CommandListener listener)
createExecCommand in interface CommandManagercommandID - a unique command IDlistener - the command listener which executes the command and updates its state
createToolCommand(java.lang.String, org.esa.beam.framework.ui.command.CommandStateListener, com.bc.ceres.swing.figure.Interactor),
createCommandGroup(java.lang.String, org.esa.beam.framework.ui.command.CommandStateListener),
addCommand(Command)
public ToolCommand createToolCommand(String commandID,
CommandStateListener listener,
com.bc.ceres.swing.figure.Interactor tool)
createToolCommand in interface CommandManagercommandID - a unique command IDlistener - the command state listener used to update the tool command's statetool - the tool which executes the command and updates its state
createExecCommand(java.lang.String, org.esa.beam.framework.ui.command.CommandListener),
createCommandGroup(java.lang.String, org.esa.beam.framework.ui.command.CommandStateListener),
addCommand(Command)
public CommandGroup createCommandGroup(String commandGroupID,
CommandStateListener listener)
createCommandGroup in interface CommandManagercommandGroupID - a unique command group IDlistener - the command state listener used to update the command group state
createExecCommand(java.lang.String, org.esa.beam.framework.ui.command.CommandListener),
createToolCommand(java.lang.String, org.esa.beam.framework.ui.command.CommandStateListener, com.bc.ceres.swing.figure.Interactor),
addCommand(Command)public int getNumCommands()
DefaultCommandManager. If this manager contains more than
Integer.MAX_VALUE elements, returns Integer.MAX_VALUE :-)
getNumCommands in interface CommandManagerDefaultCommandManager.public Command getCommandAt(int index)
DefaultCommandManager.
getCommandAt in interface CommandManagerindex - index of command to return.
Command at the specified position in this DefaultCommandManager.
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getNumCommands()).public Command getCommand(String commandID)
null if a command with the given command-ID
has not been registered (so far).
getCommand in interface CommandManagerpublic ExecCommand getExecCommand(String commandID)
null if an command with the given
command-ID has not been registered.
getExecCommand in interface CommandManagerpublic ToolCommand getToolCommand(String commandID)
null if a tool command with the given
command-ID has not been registered.
getToolCommand in interface CommandManagerpublic CommandGroup getCommandGroup(String commandID)
null if an command group with the
given command-ID has not been registered.
getCommandGroup in interface CommandManagerpublic void updateState()
updateState method of all registered commands.
updateState in interface CommandManagerpublic void updateComponentTreeUI()
updateComponentTreeUI in interface CommandManagerpublic void addCommand(Command command)
addCommand in interface CommandManagercommand - the command to be added
IllegalArgumentException - if the command ID property of the command has not been set, or if an command
with the same command ID has alreay been registeredpublic void removeCommand(Command command)
removeCommand in interface CommandManagercommand - the command to be removed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||