Jump to: navigation, search

Difference between revisions of "Menus Extension Mapping"

Line 8: Line 8:
 
*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 - 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.
 
*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:
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! 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.
 +
|}
 +
  
 
Menu locations are all defined in the <menuContribution/> locationURI attribute.
 
Menu locations are all defined in the <menuContribution/> locationURI attribute.
Line 63: Line 81:
 
| definitionId || - || This is no longer necessary.
 
| definitionId || - || This is no longer necessary.
 
|-
 
|-
| menubarPath || - || 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.
+
| toolbarPath || - || This is no longer necessary, it is part of a "toolbar:" locationURI.
 
|-
 
|-
 
| icon || icon || No difference.
 
| icon || icon || No difference.

Revision as of 14:46, 19 December 2006

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.


Menu locations are all defined in the <menuContribution/> locationURI attribute.

Extension Old Location New Location
actionSets A path of menu ids, ending in a group, rooted from the main menu bar A unique menu id, followed by an insertion hint. ex: menu:file?after=new.ext or menu:org.eclipse.ui.main.menu for the main menu bar
actionSets A toolbar group and possible insertion point. A unique toolbar id, followed by an insertion hint. ex: toolbar:org.eclipse.ui.edit.text.actionSet.presentation?after=Presentation
editorActions A path of menu ids, ending in a group, rooted from the main menu bar A unique menu id, followed by an insertion hint. ex: menu:file?after=new.ext or menu:org.eclipse.ui.main.menu for the main menu bar
editorActions A toolbar group and possible insertion point. A unique toolbar id, followed by an insertion hint. ex: toolbar:org.eclipse.ui.edit.text.actionSet.presentation?after=Presentation
viewActions An optional path of menu ids, ending in a group, rooted from the view dropdown menu A unique menu id, followed by an insertion hint. ex: menu:org.eclipse.ui.views.ContentOutline?after=additions. The view id is the dropdown menu root.
viewActions A toolbar group and possible insertion point. The view id, followed by an insertion hint. ex: toolbar:org.eclipse.ui.views.ContentOutline?after=additions. The view id is the toolbar id.
popupMenus viewerContribution - a registered popup menu with the given id A registered popup menu with the given id, followed by an insertion hint. ex: popup:#TextEditorContext?after=additions.
popupMenus objectContribution - any registered popup menu Any registered popup menu, followed by an insertion hint. ex: popup:org.eclipse.ui.menus.popup.any?after=additions.


The 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.