|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.CommandManager
A central repository for commands -- both in the defined and undefined states. Commands can be created and retrieved using this manager. It is possible to listen to changes in the collection of commands by attaching a listener to the manager.
getCommand(String)
Constructor Summary | |
---|---|
CommandManager()
|
Method Summary | |
---|---|
void |
addCommandManagerListener(ICommandManagerListener listener)
Adds a listener to this command manager. |
void |
addExecutionListener(IExecutionListener listener)
Adds an execution listener to this manager. |
void |
categoryChanged(CategoryEvent categoryEvent)
Notifies that one or more properties of an instance of Category have changed. |
void |
commandChanged(CommandEvent commandEvent)
Notifies that one or more properties of an instance of Command have changed. |
Category |
getCategory(String categoryId)
Gets the category with the given identifier. |
Command |
getCommand(String commandId)
Gets the command with the given identifier. |
Set |
getDefinedCategoryIds()
Returns the set of identifiers for those category that are defined. |
Set |
getDefinedCommandIds()
Returns the set of identifiers for those commands that are defined. |
void |
removeCommandManagerListener(ICommandManagerListener listener)
Removes a listener from this command manager. |
void |
removeExecutionListener(IExecutionListener listener)
Removes an execution listener from this command manager. |
void |
setHandlersByCommandId(Map handlersByCommandId)
Block updates all of the handlers for all of the commands. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommandManager()
Method Detail |
public final void addCommandManagerListener(ICommandManagerListener listener)
listener
- The listener to attach; must not be null
.public final void addExecutionListener(IExecutionListener listener)
listener
- The listener to attach; must not be null
.public final void categoryChanged(CategoryEvent categoryEvent)
ICategoryListener
Category
have changed. Specific details are described in
the CategoryEvent
.
categoryChanged
in interface ICategoryListener
categoryEvent
- the category event. Guaranteed not to be null
.public final void commandChanged(CommandEvent commandEvent)
ICommandListener
Command
have changed. Specific details are described in
the CommandEvent
.
commandChanged
in interface ICommandListener
commandEvent
- the command event. Guaranteed not to be null
.public final Category getCategory(String categoryId)
categoryId
- The identifier to find; must not be null
.
null
, but it might be undefined.Category
public final Command getCommand(String commandId)
commandId
- The identifier to find; must not be null
and
must not be zero-length.
null
, but it might be undefined.Command
public final Set getDefinedCategoryIds()
null
.public final Set getDefinedCommandIds()
null
.public final void removeCommandManagerListener(ICommandManagerListener listener)
listener
- The listener to be removed; must not be null
.public final void removeExecutionListener(IExecutionListener listener)
listener
- The listener to be removed; must not be null
.public final void setHandlersByCommandId(Map handlersByCommandId)
null
or the command id does not exist in the map, then
the command becomes unhandled. Otherwise, the handler is set to the
corresponding value in the map.
handlersByCommandId
- A map of command identifiers (String
) to
handlers (IHandler
). This map may be
null
if all handlers should be cleared.
Similarly, if the map is empty, then all commands will become
unhandled.
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.