|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides services related to the command architecture within the workbench. This service can be used to access the set of commands and command categories.
This interface should not be implemented or extended by clients.
Field Summary | |
---|---|
static String |
AUTOGENERATED_CATEGORY_ID
The identifier of the category in which all auto-generated commands will appear. |
Method Summary | |
---|---|
void |
addExecutionListener(IExecutionListener listener)
Adds an execution listener to the command service. |
void |
defineUncategorizedCategory(String name,
String description)
Sets the name and description of the category for uncategorized commands. |
ParameterizedCommand |
deserialize(String serializedParameterizedCommand)
Returns a ParameterizedCommand with a command and
parameterizations as specified in the provided
serializedParameterizedCommand string. |
Category |
getCategory(String categoryId)
Retrieves the category with the given identifier. |
Command |
getCommand(String commandId)
Retrieves the command with the given identifier. |
Category[] |
getDefinedCategories()
Returns the collection of all of the defined categories in the workbench. |
Collection |
getDefinedCategoryIds()
Returns the collection of the identifiers for all of the defined categories in the workbench. |
Collection |
getDefinedCommandIds()
Returns the collection of the identifiers for all of the defined commands in the workbench. |
Command[] |
getDefinedCommands()
Returns the collection of all of the defined commands in the workbench. |
Collection |
getDefinedParameterTypeIds()
Returns the collection of the identifiers for all of the defined command parameter types in the workbench. |
ParameterType[] |
getDefinedParameterTypes()
Returns the collection of all of the defined command parameter types in the workbench. |
String |
getHelpContextId(Command command)
Gets the help context identifier for a particular command. |
String |
getHelpContextId(String commandId)
Gets the help context identifier for a particular command. |
ParameterType |
getParameterType(String parameterTypeId)
Retrieves the command parameter type with the given identifier. |
void |
readRegistry()
Reads the command information from the registry and the preferences. |
void |
removeExecutionListener(IExecutionListener listener)
Removes an execution listener from the command service. |
void |
setHelpContextId(IHandler handler,
String helpContextId)
Sets the help context identifier to associate with a particular handler. |
Methods inherited from interface org.eclipse.ui.services.IDisposable |
---|
dispose |
Field Detail |
public static final String AUTOGENERATED_CATEGORY_ID
null
.
Method Detail |
public void addExecutionListener(IExecutionListener listener)
listener
- The listener to add; must not be null
.public void defineUncategorizedCategory(String name, String description)
getCategory(String)
is called with null
.
name
- The name of the category for uncategorized commands; must not
be null
.description
- The description of the category for uncategorized commands;
may be null
.public ParameterizedCommand deserialize(String serializedParameterizedCommand) throws NotDefinedException, SerializationException
Returns a ParameterizedCommand
with a command and
parameterizations as specified in the provided
serializedParameterizedCommand
string. The
serializedParameterizedCommand
must use the format
returned by ParameterizedCommand.serialize()
and described in the
Javadoc for that method.
If a parameter id encoded in the
serializedParameterizedCommand
does not exist in the
encoded command, that parameter id and value are ignored. A given
parameter id should not be used more than once in
serializedParameterizedCommand
. This will not result in
an exception, but the value of the parameter when the command is executed
cannot be specified here.
This method will never return null
, however it may throw
an exception if there is a problem processing the serialization string or
the encoded command is undefined.
serializedParameterizedCommand
- a String
representing a command id and
parameter ids and values
ParameterizedCommand
with the command and
parameterizations encoded in the
serializedParameterizedCommand
NotDefinedException
- if the command indicated in
serializedParameterizedCommand
is not defined
SerializationException
- if there is an error deserializing
serializedParameterizedCommand
NotDefinedException
ParameterizedCommand.serialize()
,
CommandManager.deserialize(String)
public Category getCategory(String categoryId)
categoryId
- The identifier to find. If the category is null
,
then a category suitable for uncategorized items is defined
and returned.
public Command getCommand(String commandId)
commandId
- The identifier to find; must not be null
.
public Category[] getDefinedCategories()
Category
) that are
defined; never null
, but may be empty.public Collection getDefinedCategoryIds()
String
)
that are defined; never null
, but may be empty.public Collection getDefinedCommandIds()
String
)
that are defined; never null
, but may be empty.public Command[] getDefinedCommands()
Command
) that are
defined; never null
, but may be empty.public Collection getDefinedParameterTypeIds()
String
)
that are defined; never null
, but may be empty.public ParameterType[] getDefinedParameterTypes()
ParameterType
)
that are defined; never null
, but may be empty.public String getHelpContextId(Command command) throws NotDefinedException
null
is returned.
command
- The command for which the help context should be retrieved;
must not be null
.
null
.
NotDefinedException
- If the given command is not defined.
NotDefinedException
public String getHelpContextId(String commandId) throws NotDefinedException
null
is returned.
commandId
- The identifier of the command for which the help context
should be retrieved; must not be null
.
null
.
NotDefinedException
- If the command with the given identifier is not defined.
NotDefinedException
public ParameterType getParameterType(String parameterTypeId)
parameterTypeId
- The identifier to find; must not be null
.
public void readRegistry()
Reads the command information from the registry and the preferences. This will overwrite any of the existing information in the command service. This method is intended to be called during start-up. When this method completes, this command service will reflect the current state of the registry and preference store.
public void removeExecutionListener(IExecutionListener listener)
listener
- The listener to remove; must not be null
.public void setHelpContextId(IHandler handler, String helpContextId)
handler
- The handler with which to register a help context identifier;
must not be null
.helpContextId
- The help context identifier to register; may be
null
if the help context identifier should be
removed.
|
Eclipse Platform Release 3.2 |
|||||||||||
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, 2006. All rights reserved.