
schema.commands.exsd Maven / Gradle / Ivy
The newest version!
<p>
The <code>org.eclipse.ui.commands</code> extension point is used to declare commands and command categories, using the <code>command</code> and <code>category</code> elements. A command is an abstract representation of some semantic behaviour, but not its actual implementation. This allows different developers to contribute specific behaviour for their individual parts. For example, there might be a "paste" command with one implementation in an editor and a different implementation in an explorer widget. These implementations are called handlers. Commands can also be viewed as declarative function pointers, or signal handlers.
</p>
An optional identifier of the extension instance.
An optional name of the extension instance.
A fully qualified identifier of the target extension point.
<p>
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 <code>id</code> attribute, only the last declared element (in order of reading the plugin registry) is considered valid. See the extension points <a href="org_eclipse_ui_actionSets.html">org.eclipse.ui.actionSets</a> and <a href="org_eclipse_ui_editorActions.html">org.eclipse.ui.editorActions</a> to understand how actions are connected to commands.
</p>
Please use <code>categoryId</code> instead.
A translatable short description of this command for display in the UI.
The unique identifier of this command.
The translatable name of this command for display in the UI. Commands are typically named in the form of an imperative verb.
<p>
The unique id of the category for this command. If this command does not specify a category it will be placed in an global "Uncategorized" category and will be filtered by default on the Keys preference page, meaning users cannot assign a key binding unless they disable the filter for "Uncategorized" commands.
</p>
<p><em>Since: 3.0</em></p>
<p>
The default handler for this command (see the <a href="org_eclipse_ui_handlers.html">org.eclipse.ui.handlers</a> extension point). If no other handler is active, this handler will be active. This handler will conflict with other handler definitions that specify no <code>activeWhen</code> conditions. If you are creating an <code>IExecutableExtension</code>, you can use the <code>defaultHandler</code> element instead.
</p>
<p><em>Since: 3.1</em></p>
<p>
The id of a <code>commandParameterType</code> indicating the type of value returned by this command. Specifying a <code>returnTypeId</code> allows clients executing the command to associate the value returned with a Java type and to convert the value to a String form that may be stored and/or passed to another command that accepts parameters of the same type.
</p>
<p><em>Since: 3.2</em></p>
<p>
The identifier of the help context that relates to this command in general. Handlers can override this context identifier to provide help that is more specific to their particular behaviours.
</p>
<p><em>Since: 3.2</em></p>
<p>
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 <code>id</code> attribute, only the last declared element (in order of reading the plugin registry) is considered valid.
</p>
A translatable short description of this category for display in the UI.
The unique identifier of this category.
The translatable name of this category for display in the UI.
<p>
Defines a parameter that a command should understand. A parameter is a way to provide more information to a handler at execution time. For example, a "show view" command might take a view as a parameter. Handlers should be able to understand these parameters, so they should be treated like API.
</p>
<p><em>Since: 3.1</em></p>
The unique identifier for this parameter.
The name for the parameter. This is the name as it will be displayed to an end-user. As such, it should be translatable. The name should be short -- preferrably one word.
The class providing a list of parameter values for the user to select. This class should implement <code>org.eclipse.core.commands.IParameterValues</code>. If this class is not specified, you must specify the more verbose <code>values</code> element. Please see <code>org.eclipse.core.runtime.IExecutableExtension</code>.
The id of a commandParameterType for this commandParameter. Specifying a typeId allows handlers of a command to convert string parameter values to objects in a consistent way and it allows potential callers of a command to look for commands that take objects of various types for their parameters.
Whether this parameter is optional. If a parameter is optional, the handler should be able to handle the absence of the parameter. By default, all parameters are optional.
<p>
Defines the object type of a commandParameter and may specify an <code>org.eclipse.core.commands.AbstractParameterValueConverter</code> subclass to convert between string parameter values and objects.
</p>
<p><em>Since: 3.2</em></p>
The unique identifier for this commandParameterType.
The fully qualified name of a Java class or interface to use as the type of this command parameter. This attribute is optional, however if omitted, <code>java.lang.Object</code> will be used as the parameter type.
The class for converting between objects and string representations of objects for command parameter values. This class should extend <code>org.eclipse.core.commands.AbstractParameterValueConverter</code>. The converter should produce and consume objects of the type indicated in the <code>type</code> attribute. If this class is not specified, this facility to convert between string and object values for this parameter type will not be available (the <code>getValueConverter()</code> on class <code>ParameterType</code> will return <code>null</code>).
<p>
The more verbose version of the <code>values</code> attribute on the <code>commandParameter</code>.
</p>
<p><em>Since: 3.1</em></p>
The class providing a list of parameter values for the user to select. This class should implement <code>org.eclipse.core.commands.IParameterValues</code>. If this class is not specified, you must specify the more verbose <code>values</code> element. Please see <code>org.eclipse.core.runtime.IExecutableExtension</code>.
<p>
A possible value for a parameter.
</p>
<p><em>Since: 3.1</em></p>
The name of the parameter to pass to the <code>IExecutableExtension</code>.
The value of the parameter to pass to the <code>IExecutableExtension</code>.
<p>
The default handler for this command. If no other handler is active, this handler will be active. This handler will conflict with other handler definitions that specify no <code>activeWhen</code> conditions. If you are not creating an <code>IExecutableExtension</code>, you can use the <code>defaultHandler</code> attribute instead.
</p>
<p><em>Since: 3.1</em></p>
The class which implements <code>org.eclipse.core.commands.IHandler</code>.
<p>
State information shared between all handlers, and potentially persisted between sessions.The state is simply a class that is loaded to look after the state. See the API Information for more details. This is not used for UI attributes like a menu contribution check box state or label.
</p>
<p><em>Since: 3.2</em></p>
The class that can be loaded to store the state of this command. State is shared amongst handlers, and can be persisted between sessions. This class must subclass <code>org.eclipse.core.commands.State</code>. Please see API Information.
<p>
A unique identifier for this state. This is used for persisting the state between sessions (if the state is an instance of <code>org.eclipse.jface.commands.PersistentState</code>). Certain common identifiers (see <code>org.eclipse.jface.menus.IMenuStateIds</code>) are understood when the command is being rendered in the menus or tool bars. The identifier only needs to be unique within the command defining the state.
</p>
<p>
The class that can be loaded to store the state of this command. This element is used if you wish to pass multiple parameters to an <code>org.eclipse.core.runtime.IExecutableExtension</code>.
</p>
<p><em>Since: 3.2</em></p>
The class that can be loaded to store the state of this command. State is shared amongst handlers, and can be persisted between sessions. This class must implement <code>org.eclipse.core.commands.State</code>. Please see API Information.
This element is used to define key configurations. If more than one of these elements exist with the same <code>id</code> attribute, only the last declared element (in order of reading the plugin registry) is considered valid. Please use the "org.eclipse.ui.bindings" extension point instead.
A translatable short description of this key configuration for display in the UI.
The unique identifier of this key configuration.
The translatable name of this key configuration for display in the UI. If this key configuration has a parent, it is not necessary to add "(extends ...)" to the name. This will be automatically added by the UI where necessary.
The unique id of the parent key configuration. If this key configuration has a parent, it will borrow all key bindings from its parent, in addition to the key bindings defined in its own key configuration.
@deprecated Please use parentId instead.
The unique id of the parent key configuration. If this key configuration has a parent, it will borrow all key bindings from its parent, in addition to the key bindings defined in its own key configuration.
This element is used to define contexts. If more than one of these elements exist with the same <code>id</code> attribute, only the last declared element (in order of reading the plugin registry) is considered valid. Please use the <a href="org_eclipse_ui_contexts.html">org.eclipse.ui.contexts</a> extension point instead.
A translatable short description of this context for display in the UI.
The unique identifier of this context.
The translatable name of this context for display in the UI. If this context has a parent, it is not necessary to add "(extends parent)" to the name. This will be automatically added by the UI where necessary.
The unique id of the parent context. If this context has a parent, it will borrow all key bindings from its parent, in addition to the key bindings defined in its own context.
@deprecated Please use "parentId" instead.
The unique id of the parent context. If this context has a parent, it will borrow all key bindings from its parent, in addition to the key bindings defined in its own context.
This element is used to define scopes. If more than one of these elements exist with the same <code>id</code> attribute, only the last declared element (in order of reading the plugin registry) is considered valid.
@deprecated Please use the "org.eclipse.ui.contexts" extension point instead.
A translatable short description of this scope for display in the UI.
@deprecated Please use the "org.eclipse.ui.contexts" extension point instead.
The unique identifier of this scope.
@deprecated Please use the "org.eclipse.ui.contexts" extension point instead.
The translatable name of this scope for display in the UI. If this scope has a parent, it is not necessary to add "(extends parent)" to the name. This will be automatically added by the UI where necessary.
@deprecated Please use the "org.eclipse.ui.contexts" extension point instead.
The unique id of the parent scope. If this scope has a parent, it will borrow all key bindings from its parent, in addition to the key bindings defined in its own scope.
@deprecated Please use the "org.eclipse.ui.contexts" extension point instead.
<p>
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.
</p>
<p>
This element has been replaced with a preference. If your application needs to change the default key configuration, then specify the following in your <code>plugin_customization.ini</code> file: <code>org.eclipse.ui/KEY_CONFIGURATION_ID=your.default.key.configuration.id</code>.
</p>
The unique id (<code>id</code> attribute) of the keyConfiguration element one wishes to be initially active.
The unique id (<code>id</code> attribute) of the keyConfiguration element one wishes to be initially active.
This element allows one to assign key sequences to commands. Please use the <code>key</code> element in the "org.eclipse.ui.bindings" extension point instead.
The unique id of the key configuration of this key binding.
@deprecated Please use keyConfigurationId instead.
The unique identifier of the command to which the key sequence specified by this key binding is assigned. If the value of this attribute is an empty string, the key sequence is assigned to an internal 'no operation' command. This is useful for 'undefining' key bindings in specific key configurations and contexts which may have been borrowed from their parents.
@deprecated Please use "commandId" instead.
An optional attribute indicating that this key binding is only defined for the specified locale. Locales are specified according to the format declared in <code>java.util.Locale</code>.
An optional attribute indicating that this key binding is only defined for the specified platform. The possible values of the <code>platform</code> attribute are the set of the possible values returned by <code>org.eclipse.swt.SWT.getPlatform()</code>.
The unique id of the context of this key binding.
The key sequence to assign to the command. Key sequences consist of one or more key strokes, where a key stroke consists of a key on the keyboard, optionally pressed in combination with one or more of the following modifiers: Ctrl, Alt, Shift, and Command. Key strokes are separated by spaces, and modifiers are separated by '+' characters.
@deprecated Please use "keySequence" instead.
The unique id of the context of this key binding.
@deprecated Please use "contextId" instead. The old default scope, "org.eclipse.ui.globalScope", has been changed to "org.eclipse.ui.contexts.window". The old name is still supported, but it is deprecated.
The unique id of the key configuration of this key binding.
@deprecated Please use the <code>schemeId</code> attribute on the <code>key</code> element in the new "org.eclipse.ui.bindings" extension point.
The unique identifier of the command to which the key sequence specified by this key binding is assigned. If the value of this attribute is an empty string, the key sequence is assigned to an internal 'no operation' command. This is useful for 'undefining' key bindings in specific key configurations and contexts which may have been borrowed from their parents.
<p>The key sequence to assign to the command. Key sequences consist of one or more key strokes, where a key stroke consists of a key on the keyboard, optionally pressed in combination with one or more of the following modifiers: Ctrl, Alt, Shift, and Command. Key strokes are separated by spaces, and modifiers are separated by '+' characters.</p>
<p>The modifier keys can also be expressed in a platform-independent way. On MacOS X, for example, "Command" is almost always used in place of "Ctrl". So, we provide "M1" which will map to either "Ctrl" or "Command", as appropriate. Similarly, "M2" is "Shift"; "M3" is "Alt"; and "M4" is "Ctrl" (MacOS X). If more platforms are added, then you can count on these aliases being mapped to good platform defaults.</p>
<p>The syntax for this string is defined in <code>org.eclipse.ui.internal.keys</code>. Briefly, the string is case insensitive -- though all capitals is preferred stylistically. If the key is a letter, then simply append the letter. If the key is a special key (i.e., non-ASCII), then use one of the following: ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, BREAK, CAPS_LOCK, END, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, HOME, INSERT, NUM_LOCK, NUMPAD_0, NUMPAD_1, NUMPAD_2, NUMPAD_3, NUMPAD_4, NUMPAD_5, NUMPAD_6, NUMPAD_7, NUMPAD_8, NUMPAD_9, NUMPAD_ADD, NUMPAD_DECIMAL, NUMPAD_DIVIDE, NUMPAD_ENTER, NUMPAD_EQUAL, NUMPAD_MULTIPLY, NUMPAD_SUBTRACT, PAGE_UP, PAGE_DOWN, PAUSE, PRINT_SCREEN, or SCROLL_LOCK. If the key is a non-printable ASCII key, then use one of the following: BS, CR, DEL, ESC, FF, LF, NUL, SPACE, TAB, or VT. Note that the main keyboard enter/return key is CR.</p>
2.1
<p>
The <code>plugin.xml</code> file in the <code>org.eclipse.ui</code> plugin makes extensive use of the <code>org.eclipse.ui.commands</code> extension point.
</p>
<p>
Handlers can be registered with commands using the <code>org.eclipse.ui.handlers.IHandlerService</code>. This can be retrieved from various workbench components (e.g., workbench, workbench window, part site, etc.) by calling <code>getService(IHandlerService.class)</code>.
</p>
<p>
In general, it is preferrably to declare all commands statically (in <code>plugin.xml</code>). This is so that users can attach key bindings to the commands. However, it is possible to declare commands at run-time. To do this, retrieve the <code>org.eclipse.ui.commands.ICommandService</code> from a workbench component, call <code>getCommand(yourCommandID)</code> and then call <code>Command.define(...)</code>.
Commands defined programmatically must be cleaned up by the plugin if it is unloaded.
</p>
<p>
There are a few default implementations of handler states that may be useful to users of this extension point:
</p>
<ul>
<li>org.eclipse.jface.commands.TextState</li>
<li>org.eclipse.jface.commands.RadioState</li>
<li>org.eclipse.jface.commands.ToggleState</li>
<li>org.eclipse.ui.handlers.RegistryRadioState</li>
<li>org.eclipse.ui.handlers.RegistryToggleState</li>
</ul>
Copyright (c) 2000, 2018 IBM Corporation and others.<br>
This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0 which accompanies
this distribution, and is available at <a
href="https://www.eclipse.org/legal/epl-2.0">https://www.eclipse.org/legal/epl-v20.html</a>/
SPDX-License-Identifier: EPL-2.0
© 2015 - 2025 Weber Informatics LLC | Privacy Policy