All Downloads are FREE. Search and download functionalities are using the official Maven repository.

schema.actionSets.exsd Maven / Gradle / Ivy

The newest version!




      
         
      
      
         <p>
This extension point is used to add menus, menu items 
and toolbar buttons to the common areas in the Workbench
window. These contributions are collectively known 
as an <i>action set</i> and appear within the 
Workbench window by the user customizing a perspective.
</p>
<p>
You can now use <a href="org_eclipse_ui_menus.html">org.eclipse.ui.menus</a> to place commands in menus and toolbars as well.
</p>
<p>
There is an implementation limitation which currently affects action sets.  It is important to define the entire menu structure that is to be referenced within the action set.  So, for example, if another action set defines a menu called "example", it is not possible to rely on "example" existing.  It is necessary to redefine the "example" menu in every action set that wishes to use it.
</p>
      
   

   

   

   
      
         
            
         
      
      
         
            
         
         
            
               
                  a fully qualified identifier of the target extension point
               
            
         
         
            
               
                  an optional identifier of the extension instance
               
            
         
         
            
               
                  an optional name of the extension instance
               
               
                  
               
            
         
      
   

   
      
         
            This element is used to define a group of actions and/or menus.
         
      
      
         
            
            
         
         
            
               
                  a unique identifier for this action set.
               
            
         
         
            
               
                  a translatable name used by the Workbench to represent this action set to the user.
               
               
                  
               
            
         
         
            
               
                  an optional attribute indicating whether the action set is initially visible when a perspective is open. This option is only honoured when the user opens a perspective which has not been customized. The user can override this option from the "Customize Perspective Dialog". This attribute should be used with great care so as not to overwhelm the user with too many actions.
               
            
         
         
            
               
                  a translatable description used by the Workbench to represent this action set to the user.
               
               
                  
               
            
         
      
   

   
      
         
            This element defines an action that the user can invoke in the UI.
         
      
      
         
            
               
               
            
            
         
         
            
               
                  a unique identifier used as a reference for this action.
               
            
         
         
            
               
                  a translatable name used either as the menu item text or toolbar button label. The name can include mnenomic information.
               
               
                  
               
            
         
         
         
            
               
                  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 <a href="org_eclipse_ui_commands.html">org.eclipse.ui.commands</a> for more information.
               
               
                  
               
            
         
         
            
               
                  a slash-delimited path ('/') 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.
               
            
         
         
            
               
                  a slash-delimited path ('/') that is used to specify the location of this action in the toolbar. The first token represents the toolbar identifier (with "Normal" 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.
               
            
         
         
            
               
                  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, or the <code>ISharedImages</code> constant. The icon will appear in toolbars but not in menus. Enabled actions will be represented in menus by the hoverIcon.
               
               
                  
               
            
         
         
         
            
               
                  a translatable text representing the action's tool tip. Only used if the action appears in the toolbar.
               
               
                  
               
            
         
         
         
            
               
                  an attribute to define the user interface style type for the action. If omitted, then it is <samp>push</samp> by default. The attribute value will be one of the following:
    <table border="0" width="80%">
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>push</b></td>
        <td valign="top">- as a regular menu item or tool item.</td>
      </tr>
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>radio</b></td>
        <td valign="top">- 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 <samp>state</samp> attribute.</td>
      </tr>
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>toggle</b></td>
        <td valign="top">- as a checked style menu item or as a toggle tool item. The initial value is specified by the <samp>state</samp> attribute.</td>
      </tr>
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>pulldown</b></td>
        <td valign="top">- as a cascading style menu item or as a drop down menu beside the tool item.</td>
      </tr>
    </table>
               
            
            
               
                  
                  
                  
                  
                  
                  
                  
                  
               
            
         
         
            
               
                  an optional attribute indicating the initial state (either <samp>true</samp> or <samp>false</samp>). Used only when the <samp>style</samp> attribute has the value <samp>radio</samp> or <samp>toggle</samp>.
               
            
         
         
            
               
                  Use the <samp>style</samp> attribute with the value <samp>pulldown</samp>.
               
               
                  
               
            
         
         
            
               
                  a fully qualified name of a class which implements <samp>org.eclipse.ui.IWorkbenchWindowActionDelegate</samp> or <samp>org.eclipse.ui.IWorkbenchWindowPulldownDelegate</samp>. The latter should be implemented in cases where the <samp>style</samp> attribute has the value <samp>pulldown</samp>. This class is the handler responsible for performing the action. If the <samp>retarget</samp> attribute is true, this attribute is ignored and should not be supplied.
               
               
                  
               
            
         
         
            
               
                  an optional attribute to retarget this action. When true, view and editor parts may supply a handler for this action using the standard mechanism for setting a global action handler on their site using this action's identifier. If this attribute is true, the <samp>class</samp> attribute should not be supplied.  <br><b>Note:</b>The combination of <code>pulldown</code> and <code>retarget</code> is not supported.  Commands can be used to provide this type of functionality, see <a href="org_eclipse_ui_menus.html">org.eclipse.ui.menus</a> and the command element with a style of <code>pulldown</code>.
               
            
         
         
            
               
                  optional attribute indicating whether the retarget action allows the handler to override it's label and tooltip. Only applies if <samp>retarget</samp> attribute is true.
               
            
         
         
            
               
                  a value indicating the selection count which must be met to enable the action. If specified and the condition is not met, the action is disabled. If omitted, the action enablement state is not affected. The following attribute formats are supported: 
    <table border="0" width="80%">
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>!</b></td>
        <td valign="top">- 0 items selected</td>
      </tr>
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>?</b></td>
        <td valign="top">- 0 or 1 items selected</td>
      </tr>
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>+</b></td>
        <td valign="top">- 1 or more items selected</td>
      </tr>
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>multiple, 2+</b></td>
        <td valign="top">- 2 or more items selected</td>
      </tr>
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>n</b></td>
        <td valign="top">- a precise number of items selected.a precise number of items selected.&nbsp;
          For example: enablesFor=&quot; 4&quot; enables the action only when 4
          items are selected</td>
      </tr>
      <tr>
 <td valign="top" width="25"></td>
        <td valign="top" nowrap><b>*</b></td>
        <td valign="top">- any number of items selected</td>
      </tr>
    </table>
               
            
         
         
            
               
                  For actions appearing in a toolbar, <code>FORCE_TEXT</code> will show text even if there is an icon.  See ActionContribuitonItem.
               
            
            
               
                  
                  
               
            
         
      
   

   
      
         
            A parameter element to be used within an IExecutableExtension element.  This will be passed as initialization data to the instantiated class.
         
      
      
         
            
               
                  the parameter name
               
            
         
         
            
               
                  the parameter value
               
            
         
      
   

   
      
         
            The element version of the <code>class</code> attribute.  This is used when the class implements <code>org.eclipse.core.runtime.IExecutableExtension</code> and there is parameterized data that you wish used in its initialization.
         
      
      
         
            
         
         
            
               
                  A class that implements <code>org.eclipse.ui.IWorkbenchWindowActionDelegate</code>.  It may also implement <code>org.eclipse.core.runtime.IExecutableExtension</code>.
               
               
                  
               
            
         
      
   

   
      
         
      
      
         The following is an example of an action set (note 
the sub-elements and the way attributes are used): 

<p>
<pre>
    <extension point = "org.eclipse.ui.actionSets"> 
        <actionSet
            id="com.xyz.actionSet" 
            label="My Actions"> 
            <menu
               id="com.xyz.xyzMenu" 
               label="XYZ Menu"
               path="additions"> 
               <separator name="group1"/>
               <separator name="option1"/>
            </menu>
            
            <action
               id="com.xyz.runXYZ" 
               label="&amp;Run XYZ Tool"
               style="toggle"
               state="false"
               menubarPath="com.xyz.xyzMenu/group1" 
               icon="icons/runXYZ.gif" 
               tooltip="Run XYZ Tool" 
               helpContextId="com.xyz.run_action_context" 
               class="com.xyz.actions.RunXYZ" 
               enablesFor="1"> 
               <selection class="org.eclipse.core.resources.IFile" name="*.java"/> 
            </action>
            <action 
               id="com.xyz.runABC"
               label="&amp;Run ABC Tool"
               style="push"
               menubarPath="com.xyz.xyzMenu/group1"
               toolbarPath="Normal/XYZ"
               icon="icons/runABC.gif"
               tooltip="Run ABC Tool"
               helpContextId="com.xyz.run_abc_action_context"
               retarget="true"
               allowLabelUpdate="true">
               <enablement>
                  <and>
                     <objectClass name="org.eclipse.core.resources.IFile"/>
                     <not>
                        <objectState name="extension" value="java"/>
                     </not>
                  </and>
               </enablement>
            </action>             

            <action 
               id="com.xyz.runDEF"
               label="&amp;Run DEF Tool"
               style="radio"
               state="true"
               menubarPath="com.xyz.xyzMenu/option1"
               icon="icons/runDEF.gif"
               tooltip="Run DEF Tool"
               class="com.xyz.actions.RunDEF" 
               helpContextId="com.xyz.run_def_action_context">
            </action>             
            <action 
               id="com.xyz.runGHI"
               label="&amp;Run GHI Tool"
               style="radio"
               state="false"
               menubarPath="com.xyz.xyzMenu/option1"
               icon="icons/runGHI.gif"
               tooltip="Run GHI Tool"
               class="com.xyz.actions.RunGHI" 
               helpContextId="com.xyz.run_ghi_action_context">
            </action>             
            <action 
               id="com.xyz.runJKL"
               label="&amp;Run JKL Tool"
               style="radio"
               state="false"
               menubarPath="com.xyz.xyzMenu/option1"
               icon="icons/runJKL.gif"
               tooltip="Run JKL Tool"
               class="com.xyz.actions.RunJKL" 
               helpContextId="com.xyz.run_jkl_action_context">
            </action>             
        </actionSet> 
    </extension> 
</pre>
</p>
<p>
In the example above, the specified action set, named "My Actions", is not initially visible within each perspective because the <samp>visible</samp> attribute is not specified.
</p>
<p>
The XYZ action will appear as a check box menu item, initially not checked. It is enabled only if the selection count is 1 and if the selection contains a Java file resource.
</p>
<p>
The ABC action will appear both in the menu and on the toolbar. It is enabled only if the selection does not contain any Java file resources. Note also this is a label retarget action therefore it does not supply a <samp>class</samp> attribute.
</p>
<p>
The actions DEF, GHI, and JKL appear as radio button menu items. They are enabled all the time, independent of the current selection state.
</p>
      
   

   
      
         
      
      
         The value of the class attribute must be the fully qualified name of a class that implements <samp>org.eclipse.ui.IWorkbenchWindowActionDelegate</samp> or <samp>org.eclipse.ui.IWorkbenchWindowPulldownDelegate</samp>. The latter should be implemented in cases where the <samp>style</samp> attribute has the value <samp>pulldown</samp>. This class is the handler responsible for performing the action. If the <samp>retarget</samp> attribute is true, this attribute is ignored and should not be supplied. This class is loaded as late as possible to avoid loading the entire plug-in before it is really needed.
<p>
The enablement criteria for an action extension is initially defined by <samp>enablesFor</samp>, and also either <samp>selection</samp> or <samp>enablement</samp>. However, once the action delegate has been instantiated, it may control the action enable state directly within its <samp>selectionChanged</samp> method.
<p>
It is important to note that the workbench does not generate menus on a plug-in's behalf. Menu paths must reference menus that already exist.
<p>
Action and menu labels may contain special characters that encode mnemonics using the following rules:
<ol>
<li>
Mnemonics are specified using the ampersand ('&amp;') character in front of a selected character in the translated text. Since ampersand is not allowed in XML strings, use <samp>&amp;amp;</samp> character entity.</li>
</ol>
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.
<p>
The <samp>selection</samp> and <samp>enablement</samp> elements are mutually exclusive. The <samp>enablement</samp> element can replace the <samp>selection</samp> element using the sub-elements <samp>objectClass</samp> and <samp>objectState</samp>. For example, the following:
<pre>
 <selection
  class="org.eclipse.core.resources.IFile"
  name="*.java">
 </selection>
</pre>
can be expressed using:
<pre>
 <enablement>
  <and>
   <objectClass name="org.eclipse.core.resources.IFile"/>
   <objectState name="extension" value="java"/>
  </and>
 </enablement>
</pre>
      
   


   
      
         
      
      
         Plug-ins may use this extension point to add new top level menus. Plug-ins can also define named groups which allow other plug-ins to contribute their actions into them. 
<p>
Top level menus are created by using the following values
for the path attribute: 
<ul>
<li>additions - represents a group immediately to the left of the <samp>Window</samp> menu. 
</ul>
Omitting the path attribute will result in adding the new menu into the additions menu bar group. 
</p>
<p>
The default groups in a workbench window are defined in the
<samp>IWorkbenchActionConstants</samp> interface. These
constants can be used in code for dynamic contribution.
The values can also be copied into an XML file for fine
grained integration with the existing workbench menus
and toolbar. 
</p>
<p>
Various menu and toolbar items within the workbench 
window are defined algorithmically.  In these cases 
a separate mechanism must be used to extend the 
window. For example, adding a new workbench view 
results in a new menu item appearing in the
Perspective menu. Import, Export, and New Wizards 
extensions are also added automatically to the window.
</p>
      
   

   
      
         
      
      
         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