blob: b3ff8e595d8769a4e08755f97544e3fcf999cdaf [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Eclipse Workbench Extension Point: Accelerator Sets</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4613.1700" name=GENERATOR></HEAD>
<BODY vLink=#800080 link=#0000ff>
<CENTER>
<H1>Accelerator Sets</H1></CENTER><B><I>Identifier:
</I></B>org.eclipse.ui.acceleratorSets
<P><B><I>Description: </I></B>This extension point is used to register accelerator set extensions.
Accelerator sets are just what the name implies, sets of accelerators. An accelerator is an association bewteen
one or more sequences of accelerator keys and a workbench action. An accelerator key
sequence may be of length one or greater.
<P>An accelerator set is registered with an accelerator configuration (see the <a href="org_eclipse_ui_acceleratorConfigurations.html">Accelerator Configuration</a> extension point)
and is applicable for an accelerator scope (see the <a href="org_eclipse_ui_acceleratorScopes.html">Accelerator Scope</a> extension point).
<P><B><I>Since:</I></B> Release 2.0
<P><B><I>Configuration Markup:</I></B>
<P><TT>&nbsp;&nbsp; &lt;!ELEMENT acceleratorSet (accelerator)+&gt;</TT> <BR><TT>&nbsp;&nbsp;
&lt;!ATTLIST acceleratorSet</TT> <BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
configurationId&nbsp;&nbsp;&nbsp;&nbsp; CDATA
#REQUIRED</TT> <BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
scopeId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA
#REQUIRED</TT> <BR><TT>&nbsp;&nbsp; &gt;</TT>
<UL>
<LI>
<B>configurationId -</B> a unique name that identifies the accelerator
configuration to which this accelerator set is registered.
<LI>
<B>scopeId</B> - a unique name that identifies the accelerator scope
for which this accelerator set is applicable.</LI>
</UL><TT>&nbsp;&nbsp; &lt;!ELEMENT accelerator EMPTY&gt;</TT>
<BR><TT>&nbsp;&nbsp; &lt;!ATTLIST accelerator</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #REQUIRED</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA
#REQUIRED</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
locale&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDATA
#OPTIONAL</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
platform&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
CDATA #OPTIONAL</TT>
<BR><TT>&nbsp;&nbsp; &gt;</TT>
<UL>
<LI>
<B>id</B> - the unique identifier of the action definition of the action associated with this accelerator.
<LI>
<B>key</B> - an attribute representing the sequence(s) of accelerator keys used to perform the action
associated with this accelerator. Sequences are separated by '||', and individual keys in a sequence are separated by a space.
A key may be modified by the CTRL, ALT, or SHIFT keys. Depending on keyboard layout, some keys ('?' for example) may
need the SHIFT to be accessed but the accelerator should be specified without the SHIFT so it will be independent
of keyboard layout. E.g. if CTRL+? is specified as an accelerator, the user may have to press CTRL+SHIFT+? depending
on the keyboard layout.
<LI>
<B>locale</B> - an optional attribute which specifies a locale for which the accelerator is applicable. If this
attribute is not specified, the accelerator is applicable for all locales.
<LI>
<B>platform</B> - an optional attribute which specifies a platform on which the accelerator is applicable. If this
attribute is not specified, the accelerator is applicable on all platforms.
</UL>
<blockquote>
<P>More than one accelerator may be specified for the same action in the accelerator set but only one will be used.
<P>If the locale and/or the platform is specified, the accelerator that better matches the current locale and platform will be
used. The current locale is determined by the API Locale.getDefault() and the platform by the API SWT.getPlatform(). If the
platform and/or the locale is specified and it does not match the current locale and/or platform, the accelerator is discarded.
If accelerator A defines only the locale and B defines only the platform, B is used.
If accelerator A defines "ja" as its locale and B defines "ja_JP", B is used in case the current locale is "ja_JP".
<P>If two accelerators are defined in accelerators sets in different plugins, the chosen accelerator will depend on the plugins.
If plugin A depends on B, the accelerators defined in B is used.
If A and B don't depend on each other, they will be alphabetically sorted by the plugin id.
<P>If two accelerators are defined in different scopes, the accelerator defined in the current scope will be used.
If an accelerator is not defined in the current scope or one of its parents it is discarded.
If an accelerator is defined in a parent and child scope, the one in the child is used.
</blockquote>
<P><B><I>Examples:</I></B>
<P>Following is an example of an accelerator set extension:
<P><TT>&nbsp;&nbsp; &lt;extension point="org.eclipse.ui.acceleratorSets"&gt;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;acceleratorSet</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configurationId="org.eclipse.ui.exampleAcceleratorConfiguration"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scopeId="org.eclipse.ui.globalScope"&gt;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;accelerator</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
id="org.eclipse.ui.ExampleActionA"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
key="CTRL+R CTRL+A"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/accelerator&gt;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;accelerator</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
id="org.eclipse.ui.ExampleActionB"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
key="CTRL+R CTRL+B"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/accelerator&gt;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;accelerator</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
id="org.eclipse.ui.ExampleActionC"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
key="CTRL+R CTRL+C || CTRL+SHIFT+DELETE"</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/accelerator&gt;</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/acceleratorSet&gt;</TT>
<BR><TT>&nbsp;&nbsp; &lt;/extension&gt;</TT>
<P><B><I>API Information: </I></B>None.
<P><B><I>Supplied Implementation: </I></B>The workbench provides accelerator sets for the Default and Emacs
accelerator configurations.
<p><a href="hglegal2002.htm"><img SRC="ngibmcpy2002.gif" ALT="Copyright IBM Corporation and others 2000, 2002." BORDER=0></a>
</body>
</html>