blob: 08ba1c3c29ca7a0a78eba79aac43e76915d25d11 [file] [log] [blame]
<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.ui">
<annotation>
<appInfo>
<meta.schema plugin="org.eclipse.ui" id="editorActions" name="Editor Menus, Toolbars and Actions"/>
</appInfo>
<documentation>
This extension point is used to add actions to the menu
and toolbar for editors registered by other plug-ins.
&lt;p&gt;
The initial contribution set for an editor is defined
by another extension point (org.eclipse.ui.editors).
One set of actions is created and shared by all
instances of the same editor type. When invoked,
these action act upon the active editor. This
extension point follows the same pattern. Each
action extension is created and shared by all
instances of the same editor type. The action
class is required to implement
&lt;samp&gt;org.eclipse.ui.IEditorActionDelegate&lt;/samp&gt;.
The active editor is passed to the delegate by invoking
&lt;samp&gt;IEditorActionDelegate.setActiveEditor&lt;/samp&gt;.
</documentation>
</annotation>
<include schemaLocation="commonAction.exsd"/>
<include schemaLocation="commonExpression.exsd"/>
<element name="extension">
<complexType>
<sequence>
<element ref="editorContribution" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
<documentation>
a fully qualified identifier of the target extension point
</documentation>
</annotation>
</attribute>
<attribute name="id" type="string">
<annotation>
<documentation>
an optional identifier of the extension instance
</documentation>
</annotation>
</attribute>
<attribute name="name" type="string">
<annotation>
<documentation>
an optional name of the extension instance
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
</complexType>
</element>
<element name="editorContribution">
<annotation>
<documentation>
This element is used to define a group of editor actions and/or menus.
</documentation>
</annotation>
<complexType>
<sequence>
<element ref="menu" minOccurs="0" maxOccurs="unbounded"/>
<element ref="action" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
a unique identifier used to reference this contribution.
</documentation>
</annotation>
</attribute>
<attribute name="targetID" type="string" use="required">
<annotation>
<documentation>
a unique identifier of a registered editor that is the target of this contribution.
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<element name="action">
<annotation>
<appInfo>
<meta.element labelAttribute="label" icon="icon"/>
</appInfo>
<documentation>
This element defines an action that the user can invoke in the UI.
</documentation>
</annotation>
<complexType>
<choice>
<element ref="selection" minOccurs="0" maxOccurs="unbounded"/>
<element ref="enablement" minOccurs="0" maxOccurs="1"/>
</choice>
<attribute name="id" type="string" use="required">
<annotation>
<documentation>
a unique identifier used as a reference for this action.
</documentation>
</annotation>
</attribute>
<attribute name="label" type="string" use="required">
<annotation>
<documentation>
a translatable name used either as the menu item text or toolbar button label. The name can include mnenomic information. This label should either be non-empty or a definitionId should be provided.
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
<attribute name="accelerator" type="string">
<annotation>
<documentation>
&lt;b&gt;&lt;font color=&quot;#FF0000&quot;&gt;Deprecated:&lt;/font&gt;&lt;/b&gt; Use the &lt;samp&gt;definitionId&lt;/samp&gt; attribute instead.
</documentation>
<appInfo>
<meta.attribute deprecated="true"/>
</appInfo>
</annotation>
</attribute>
<attribute name="definitionId" type="string">
<annotation>
<documentation>
Specifies the command that this action will handle. By specifying and action, the key binding service can assign a key sequence to this action. See the extension point &lt;a href=&quot;org_eclipse_ui_commands.html&quot;&gt;org.eclipse.ui.commands&lt;/a&gt; for more information.
</documentation>
</annotation>
</attribute>
<attribute name="menubarPath" type="string">
<annotation>
<documentation>
a slash-delimited path (&apos;/&apos;) used to specify the location of this action in the menu bar.
Each token in the path, except the last one, must represent a valid identifier of an existing menu in the hierarchy. The last token represents the named group into which this action will be added. If the path is omitted, this action will not appear in the menu bar.
</documentation>
</annotation>
</attribute>
<attribute name="toolbarPath" type="string">
<annotation>
<documentation>
a slash-delimited path (&apos;/&apos;) that is used to specify the location of this action in the toolbar. The first token represents the toolbar identifier (with &quot;Normal&quot; being the default toolbar), while the second token is the named group within the toolbar that this action will be added to. If the group does not exist in the toolbar, it will be created.
If toolbarPath is omitted, the action will not appear in the toolbar.
</documentation>
</annotation>
</attribute>
<attribute name="icon" type="string">
<annotation>
<documentation>
a relative path of an icon used to visually represent the action in its context.
If omitted and the action appears in the toolbar, the Workbench will use a placeholder icon. The path is relative to the location of the plugin.xml file of the contributing plug-in. The icon will appear in toolbars but not in menus. Enabled actions will be represented in menus by the hoverIcon.
</documentation>
<appInfo>
<meta.attribute kind="resource"/>
</appInfo>
</annotation>
</attribute>
<attribute name="disabledIcon" type="string">
<annotation>
<documentation>
a relative path of an icon used to visually represent the action in its context when the action is disabled. If omitted, the normal icon will simply appear greyed out. The path is relative to the location of the plugin.xml file of the contributing plug-in. The disabled icon will appear in toolbars but not in menus. Icons for disabled actions in menus will be supplied by the OS.
</documentation>
<appInfo>
<meta.attribute kind="resource"/>
</appInfo>
</annotation>
</attribute>
<attribute name="hoverIcon" type="string">
<annotation>
<documentation>
a relative path of an icon used to visually represent the action in its context when the mouse pointer is over the action. If omitted, the normal icon will be used. The path is relative to the location of the plugin.xml file of the contributing plug-in.
</documentation>
<appInfo>
<meta.attribute kind="resource"/>
</appInfo>
</annotation>
</attribute>
<attribute name="tooltip" type="string">
<annotation>
<documentation>
a translatable text representing the action&apos;s tool tip. Only used if the action appears in the toolbar.
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
</appInfo>
</annotation>
</attribute>
<attribute name="helpContextId" type="string">
<annotation>
<documentation>
a unique identifier indicating the help context for this action. If the action appears as a menu item, then pressing F1 while the menu item is highlighted will display help.
</documentation>
</annotation>
</attribute>
<attribute name="style" use="default" value="push">
<annotation>
<documentation>
an optional attribute to define the user interface style type for the action. If defined, the attribute value will be one of the following:
&lt;table border=&quot;0&quot; width=&quot;80%&quot;&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;push&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- as a regular menu item or tool item.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;radio&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- as a radio style menu item or tool item. Actions with the radio style within the same menu or toolbar group behave as a radio set. The initial value is specified by the &lt;samp&gt;state&lt;/samp&gt; attribute.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;toggle&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- as a checked style menu item or as a toggle tool item. The initial value is specified by the &lt;samp&gt;state&lt;/samp&gt; attribute.&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</documentation>
</annotation>
<simpleType>
<restriction base="string">
<enumeration value="push">
</enumeration>
<enumeration value="radio">
</enumeration>
<enumeration value="toggle">
</enumeration>
</restriction>
</simpleType>
</attribute>
<attribute name="state" type="boolean">
<annotation>
<documentation>
an optional attribute indicating the initial state (either &lt;samp&gt;true&lt;/samp&gt; or &lt;samp&gt;false&lt;/samp&gt;), used when the &lt;samp&gt;style&lt;/samp&gt; attribute has the value &lt;samp&gt;radio&lt;/samp&gt; or &lt;samp&gt;toggle&lt;/samp&gt;.
</documentation>
</annotation>
</attribute>
<attribute name="class" type="string" use="required">
<annotation>
<documentation>
the name of the fully qualified class that implements &lt;samp&gt;org.eclipse.ui.IEditorActionDelegate&lt;/samp&gt;
</documentation>
<appInfo>
<meta.attribute kind="java" basedOn="org.eclipse.ui.IEditorActionDelegate"/>
</appInfo>
</annotation>
</attribute>
<attribute name="enablesFor" type="string">
<annotation>
<documentation>
a value indicating the selection count which must be met to enable the action.
If this attribute is specified and the condition is met, the action is enabled.
If the condition is not met, the action is disabled.
If no attribute is specified, the action is enabled for any number of items selected.
The following attribute formats are supported:
&lt;table border=&quot;0&quot; width=&quot;80%&quot;&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;!&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- 0 items selected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;?&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- 0 or 1 items selected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;+&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- 1 or more items selected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;multiple, 2+&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- 2 or more items selected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;n&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- a precise number of items selected.a precise number of items selected.&amp;nbsp;
For example: enablesFor=&amp;quot; 4&amp;quot; enables the action only when 4
items are selected&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;25&quot;&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot; nowrap&gt;&lt;b&gt;*&lt;/b&gt;&lt;/td&gt;
&lt;td valign=&quot;top&quot;&gt;- any number of items selected&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</documentation>
</annotation>
</attribute>
<attribute name="actionID" type="string">
<annotation>
<documentation>
Internal tag for use by the text editors. Should not be used by plug-in developers. The following IDs have special meaning for the text editor framework:
&lt;ul&gt;
&lt;li&gt;&quot;RulerClick&quot;: the contributed action which is invoked upon single-click in the (left) vertical ruler&lt;/li&gt;
&lt;li&gt;&quot;RulerDoubleClick&quot;: the contributed action which is invoked upon single-click in the (left) vertical ruler&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
If multiple extensions contribute ruler actions to the same text editor, the extension whose plug-in is at the top of the prerequisite tree wins. If there are multiple such plug-ins, the first wins.
&lt;/p&gt;
</documentation>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
<appInfo>
<meta.section type="examples"/>
</appInfo>
<documentation>
The following is an example of an editor action extension:
&lt;p&gt;
&lt;pre&gt;
&lt;extension point=&quot;org.eclipse.ui.editorActions&quot;&gt;
&lt;editorContribution
id=&quot;com.xyz.xyzContribution&quot;
targetID=&quot;com.ibm.XMLEditor&quot;&gt;
&lt;menu
id=&quot;XYZ&quot;
label=&quot;&amp;amp;XYZ Menu&quot;&gt;
&lt;separator name=&quot;group1&quot;/&gt;
&lt;/menu&gt;
&lt;action
id=&quot;com.xyz.runXYZ&quot;
label=&quot;&amp;amp;Run XYZ Tool&quot;
menubarPath=&quot;XYZ/group1&quot;
toolbarPath=&quot;Normal/additions&quot;
style=&quot;toggle&quot;
state=&quot;true&quot;
icon=&quot;icons/runXYZ.gif&quot;
tooltip=&quot;Run XYZ Tool&quot;
helpContextId=&quot;com.xyz.run_action_context&quot;
class=&quot;com.xyz.actions.RunXYZ&quot;&gt;
&lt;selection class=&quot;org.eclipse.core.resources.IFile&quot; name=&quot;*.java&quot;/&gt;
&lt;/action&gt;
&lt;/editorContribution&gt;
&lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
In the example above, the specified action will appear as a check box item in the new top-level menu named &quot;XYZ Menu&quot;, and as a toggle button in the toolbar. The action is enabled if the selection contains only Java file resources.
&lt;p&gt;
The following is an other example of an editor action extension:
&lt;p&gt;
&lt;pre&gt;
&lt;extension point=&quot;org.eclipse.ui.editorActions&quot;&gt;
&lt;editorContribution
id=&quot;com.xyz.xyz2Contribution&quot;
targetID=&quot;com.ibm.XMLEditor&quot;&gt;
&lt;menu
id=&quot;XYZ2&quot;
label=&quot;&amp;amp;XYZ2 Menu&quot;
path=&quot;edit/additions&quot;&gt;
&lt;separator name=&quot;group1&quot;/&gt;
&lt;/menu&gt;
&lt;action
id=&quot;com.xyz.runXYZ2&quot;
label=&quot;&amp;amp;Run XYZ2 Tool&quot;
menubarPath=&quot;edit/XYZ2/group1&quot;
style=&quot;push&quot;
icon=&quot;icons/runXYZ2.gif&quot;
tooltip=&quot;Run XYZ2 Tool&quot;
helpContextId=&quot;com.xyz.run_action_context2&quot;
class=&quot;com.xyz.actions.RunXYZ2&quot;&gt;
&lt;enablement&gt;
&lt;and&gt;
&lt;objectClass name=&quot;org.eclipse.core.resources.IFile&quot;/&gt;
&lt;not&gt;
&lt;objectState name=&quot;extension&quot; value=&quot;java&quot;/&gt;
&lt;/not&gt;
&lt;/and&gt;
&lt;/enablement&gt;
&lt;/action&gt;
&lt;/editorContribution&gt;
&lt;/extension&gt;
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
In the example above, the specified action will appear as a menu item in the sub-menu named &quot;XYZ2 Menu&quot; in the top level &quot;Edit&quot; menu. The action is enabled if the selection contains no Java file resources.
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="apiInfo"/>
</appInfo>
<documentation>
The value of the class attribute must be a fully qualified
name of a Java class that implements
&lt;samp&gt;org.eclipse.ui.IEditorActionDelegate&lt;/samp&gt;.
This class is loaded as late as possible to
avoid loading the entire plug-in before it is really
needed. The method &lt;samp&gt;setActiveEditor&lt;/samp&gt; will be
called each time an editor of the specified type is
activated. Only one set of actions and menus will be
created for all instances of the specified editor
type, regardless of the number of editor instances
currently opened in the Workbench.
&lt;p&gt;
This extension point can be used to contribute actions
into menus previously created by the target editor.
In addition, menus and actions can be contributed to
the Workbench window. The identifiers for actions and
major groups within the Workbench window are defined in
&lt;samp&gt;org.eclipse.ui.IWorkbenchActionConstants&lt;/samp&gt;.
These should be used as a reference point for
the addition of new actions. Top level menus are
created by using the following values for the
path attribute:
&lt;ul&gt;
&lt;li&gt;
additions - represents a named group immediately to the left of the &lt;samp&gt;Window&lt;/samp&gt; menu.
&lt;/li&gt;
&lt;/ul&gt;
Omitting the path attribute will result in adding the new menu into the additions menu bar group.
&lt;p&gt;
Actions and menus added into these paths will only
be shown while the associated editor is active. When
the editor is closed, menus and actions will be removed.
&lt;p&gt;
The enablement criteria for an action extension is initially defined by &lt;samp&gt;enablesFor&lt;/samp&gt;, and also either &lt;samp&gt;selection&lt;/samp&gt; or &lt;samp&gt;enablement&lt;/samp&gt;. However, once the action delegate has been instantiated, it may control the action enable state directly within its &lt;samp&gt;selectionChanged&lt;/samp&gt; method.
&lt;p&gt;
Action and menu labels may contain special characters that encode mnemonics using the following rules:
&lt;ol&gt;
&lt;li&gt;
Mnemonics are specified using the ampersand (&apos;&amp;amp;&apos;) character in front
of a selected character in the translated text. Since ampersand is not
allowed in XML strings, use &lt;samp&gt;&amp;amp;amp;&lt;/samp&gt; character entity.&lt;/li&gt;
&lt;/ol&gt;
If two or more actions are contributed to a menu or toolbar by a single
extension the actions will appear in the reverse order of how they are
listed in the plugin.xml file. This behavior is admittedly unintuitive.
However, it was discovered after the Eclipse Platform API was frozen.
Changing the behavior now would break every plug-in which relies upon the
existing behavior.
&lt;p&gt;
The &lt;samp&gt;selection&lt;/samp&gt; and &lt;samp&gt;enablement&lt;/samp&gt; elements are mutually exclusive. The &lt;samp&gt;enablement&lt;/samp&gt; element can replace the &lt;samp&gt;selection&lt;/samp&gt; element using the sub-elements &lt;samp&gt;objectClass&lt;/samp&gt; and &lt;samp&gt;objectState&lt;/samp&gt;. For example, the following:
&lt;pre&gt;
&lt;selection
class=&quot;org.eclipse.core.resources.IFile&quot;
name=&quot;*.java&quot;&gt;
&lt;/selection&gt;
&lt;/pre&gt;
can be expressed using:
&lt;pre&gt;
&lt;enablement&gt;
&lt;and&gt;
&lt;objectClass name=&quot;org.eclipse.core.resources.IFile&quot;/&gt;
&lt;objectState name=&quot;extension&quot; value=&quot;java&quot;/&gt;
&lt;/and&gt;
&lt;/enablement&gt;
&lt;/pre&gt;
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="implementation"/>
</appInfo>
<documentation>
The Workbench provides a built-in &quot;Default Text Editor&quot;. Plug-ins can contribute into this default editor or editors provided by other plug-ins.
</documentation>
</annotation>
<annotation>
<appInfo>
<meta.section type="copyright"/>
</appInfo>
<documentation>
Copyright (c) 2000, 2005 IBM Corporation and others.&lt;br&gt;
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 &lt;a
href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
</documentation>
</annotation>
</schema>