Menus Extension Mapping

From Eclipsepedia

Revision as of 14:48, 19 December 2006 by Pwebster.ca.ibm.com (Talk | contribs)

Jump to: navigation, search

This is mostly tables and descriptions of mappings from the extension points org.eclipse.ui.actionSets, org.eclipse.ui.editorActions, org.eclipse.ui.viewActions, and org.eclipse.ui.popupMenus to the new org.eclipse.ui.menus extension point.

A mapping from the 4 extension points to the new org.eclipse.ui.menus extension point.

  • org.eclipse.ui.actionSets: place actions and menus in the main menu bar, and actions in the main toolbar. The actions are visible when the action set is visible.
  • org.eclipse.ui.viewActions: place actions and menus in the view dropdown menu, and actions in the view toolbar. The actions are always visible.
  • org.eclipse.ui.editorActions: place actions and menus in the main menu bar, and actions in the main toolbar. The actions are visible when the editor of that type is active.
  • org.eclipse.ui.popupMenus - viewerContribution: place actions and menus in a context menu that matched the specified context id. The actions are always visible.
  • org.eclipse.ui.popupMenus - objectContribution: place actions and menus in any context menu. The actions are visible when the objectClass and filter criteria are met.

Top level extension element mappings:

Extension Old Element New Element Differences
actionSets actionSet menuContribution/TBD Menu placement is covered by menuContributions, and the definition and visibility of actionsets is coming in 3.3M5.
viewActions viewerContribution menuContribution The viewerContribution targetID is part of the menuContribution locationURI.
editorActions editorContribution menuContribution The editorContribution targetID becomes part of item and menu element visibleWhen expressions.
popupMenus viewerContribution menuContribution The viewerContribution targetID is part of the menuContribution locationURI, and targets the unique identifier of a context menu inside a view or editor part.
popupMenus objectContribution menuContribution An objectContribution is identified as a menuContribution with a locationURI that starts with "popup:org.eclipse.ui.menus.popup.any". Visibility criteria like objectClass and filter will be controlled by each element's visibleWhen expression. Enablement is controlled by the active handler for an item's command.


The common elements have a different structure in the org.eclipse.ui.menus extension point.

Old Element New Element Differences
<menu/> <menu/> The new menu allows an icon to be specified, and splits the mnemonic out from the label.
<separator/> <separator/> The separator specifies its visibility.
<groupMarker/> <separator/> A group marker is a separator with visibility set to false.
<action/> <item/> It has a separate difference table.


Differences between <action/> and <item/>

Action Attribute Item Attribute Differences
id id The item id is a unique identifier for the item, but is optional.
label label The item label doesn't include the &. If it is left out, the Command name is used.
accelerator - This is done through org.eclipse.ui.bindings.
definitionId - This is no longer necessary.
menubarPath - This is no longer necessary, it is part of a "menu:" or "popup:" locationURI.
toolbarPath - This is no longer necessary, it is part of a "toolbar:" locationURI.
icon icon No difference.
disabledIcon disabledIcon This is coming in 3.3M5.
hoverIcon hoverIcon This is coming in 3.3M5.
tooltip tooltip No difference.
helpContextId helpContextId This is coming in 3.3M5.
style TBD This is coming in 3.3M5.
state TBD This is coming in 3.3M5.
pulldown - This is no longer necessary.
class - This is no longer necessary, the item executes the specified command.
retarget - This is no longer necessary. All commands are like retargetable actions.
allowLabelUpdate - This is no longer necessary.
enablesFor - This is no longer necessary, the active handler decides if it is enabled and can use core expressions.
actionID - Using items and commands, the handler activation will determine which handler gets to run, so I suspect this is not necessary.
- commandId The id of the command to execute.
- mnemonic The letter to assign the & to.
selection subelement enabledWhen subelement All enablement is done through core expressions.
enablement subelement enabledWhen subelement All enablement is done through core expressions.
class subelement parameter subelements The class subelement could be used to pass declaration arguments to IActionDelegate. For items, the parameter subelements can pass declaration parameters to the command to be executed, if that command takes parameters.