Commands

Identifier: org.eclipse.ui.commands

Since:

2.1

Description:

The org.eclipse.ui.commands extension point is used to declare commands and command categories, using the command and category elements. Through this extension point, one can also assign key sequences to commands using the keyBinding element. Key sequences are bound to commands based on key configurations and scopes which are declared here as well, using the keyConfiguration and scope elements.

Configuration Markup:

   <!ELEMENT extension (activeKeyConfiguration , category , command , keyBinding , keyConfiguration , scope)>

   <!ATTLIST extension
     id    CDATA #IMPLIED
     name  CDATA #IMPLIED
     point CDATA #REQUIRED
   >

   <!ELEMENT activeKeyConfiguration EMPTY>

   This element is used to define the initial active key configuration for Eclipse. If more than one of these elements exist, only the last declared element (in order of reading the plugin registry) is considered valid.

   <!ATTLIST activeKeyConfiguration
     value CDATA #IMPLIED
   >

   <!ELEMENT category EMPTY>

   In the UI, commands are often organized by category to make them more manageable. This element is used to define these categories. Commands can add themselves to at most one category. If more than one of these elements exist with the same id attribute, only the last declared element (in order of reading the plugin registry) is considered valid.

   <!ATTLIST category
     description CDATA #IMPLIED
     id          CDATA #REQUIRED
     name        CDATA #REQUIRED
   >

   <!ELEMENT command EMPTY>

   This element is used to define commands. A command represents an request from the user that can be handled by an action, and should be semantically unique among other commands. Do not define a command if there is already one defined with the same meaning. If more than one of these elements exist with the same id attribute, only the last declared element (in order of reading the plugin registry) is considered valid. See the extension points org.eclipse.ui.actionSets and org.eclipse.ui.editorActions to understand how actions are connected to commands.

   <!ATTLIST command
     category    CDATA #IMPLIED
     description CDATA #IMPLIED
     icon        CDATA #IMPLIED
     id          CDATA #REQUIRED
     name        CDATA #REQUIRED
   >

   <!ELEMENT keyBinding EMPTY>

   This element allows one to assign key sequences to commands.

   <!ATTLIST keyBinding
     configuration CDATA #REQUIRED
     command       CDATA #IMPLIED
     locale        CDATA #IMPLIED
     platform      CDATA #IMPLIED
     scope         CDATA #REQUIRED
     string        CDATA #REQUIRED
   >

   <!ELEMENT keyConfiguration EMPTY>

   This element is used to define key configurations. If more than one of these elements exist with the same id attribute, only the last declared element (in order of reading the plugin registry) is considered valid.

   <!ATTLIST keyConfiguration
     description CDATA #IMPLIED
     id          CDATA #REQUIRED
     name        CDATA #REQUIRED
     parent      CDATA #IMPLIED
   >

   <!ELEMENT scope EMPTY>

   This element is used to define scopes. If more than one of these elements exist with the same id attribute, only the last declared element (in order of reading the plugin registry) is considered valid.

   <!ATTLIST scope
     description CDATA #IMPLIED
     id          CDATA #REQUIRED
     name        CDATA #REQUIRED
     parent      CDATA #IMPLIED
   >
Examples:

The plugin.xml file in the org.eclipse.ui plugin makes extensive use of the org.eclipse.ui.commands extension point.

API Information:

This is no public API for declaring commands, categories, key bindings, key configurations, or scopes other than this extension point. Public API for querying and setting scopes, as well as registering actions to handle specific commands can be found in org.eclipse.ui.IKeyBindingService.

Copyright (c) 2000, 2003 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html