Eclipse Platform
Release 3.1

org.eclipse.ui.commands
Interface ICommandService


public interface ICommandService

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.

Since:
3.1

Method Summary
 void addExecutionListener(IExecutionListener listener)
          Adds an execution listener to the command service.
 Category getCategory(String categoryId)
          Retrieves the category with the given identifier.
 Command getCommand(String commandId)
          Retrieves the command with the given identifier.
 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.
 void readRegistry()
           Reads the command information from the registry and the preferences.
 void removeExecutionListener(IExecutionListener listener)
          Removes an execution listener from the command service.
 

Method Detail

addExecutionListener

public void addExecutionListener(IExecutionListener listener)
Adds an execution listener to the command service. This listener will be notified as commands are executed.

Parameters:
listener - The listener to add; must not be null.

getCategory

public Category getCategory(String categoryId)
Retrieves the category with the given identifier. If no such category exists, then an undefined category with the given id is created.

Parameters:
categoryId - The identifier to find; must not be null.
Returns:
A category with the given identifier, either defined or undefined.

getCommand

public Command getCommand(String commandId)
Retrieves the command with the given identifier. If no such command exists, then an undefined command with the given id is created.

Parameters:
commandId - The identifier to find; must not be null.
Returns:
A command with the given identifier, either defined or undefined.

getDefinedCategoryIds

public Collection getDefinedCategoryIds()
Returns the collection of the identifiers for all of the defined categories in the workbench.

Returns:
The collection of category identifiers (String) that are defined; never null, but may be empty.

getDefinedCommandIds

public Collection getDefinedCommandIds()
Returns the collection of the identifiers for all of the defined commands in the workbench.

Returns:
The collection of command identifiers (String) that are defined; never null, but may be empty.

readRegistry

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.


removeExecutionListener

public void removeExecutionListener(IExecutionListener listener)
Removes an execution listener from the command service.

Parameters:
listener - The listener to remove; must not be null.

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.