![JAR search and dependency download from the Maven repository](/logo.png)
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 it's 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.
</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 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.
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, 2007 IBM Corporation and others.<br>
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which accompanies
this distribution, and is available at <a
href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy