Difference between revisions of "Menus Extension Mapping"

From Eclipsepedia

Jump to: navigation, search
m
 
(7 intermediate revisions by one user not shown)
Line 15: Line 15:
 
! Extension !! Old Element !! New Element !! Differences
 
! 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.
+
| actionSets || actionSet || menuContribution/TBD || Menu placement is covered by menuContributions.  In 3.3M5 action sets generate and activate contexts with the same id.  Definition decisions will be made in '''.3.M6'''
 
|-
 
|-
 
| viewActions || viewerContribution || menuContribution || The viewerContribution targetID is part of the menuContribution locationURI.
 
| viewActions || viewerContribution || menuContribution || The viewerContribution targetID is part of the menuContribution locationURI.
Line 23: Line 23:
 
| 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 || 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.
+
| 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 command contribution.
 
|}
 
|}
  
Line 37: Line 37:
 
| <separator/> || <separator/> || The separator specifies its visibility.
 
| <separator/> || <separator/> || The separator specifies its visibility.
 
|-
 
|-
| <groupMarker/> || <separator/> || A group marker is a separator with visibility set to false.
+
| <groupMarker/> || <separator/> || A group marker is a separator with visibility set to false and it must be named.
 
|-
 
|-
| <action/> || <item/> || It has a separate difference table.
+
| <action/> || <command/> || It has a separate difference table.
 
|}
 
|}
  
  
Differences between <action/> and <item/>
+
Differences between <action/> and <command/>
  
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 63: Line 63:
 
| icon || icon || No difference.
 
| icon || icon || No difference.
 
|-
 
|-
| disabledIcon || disabledIcon || This is coming in 3.3M5.
+
| disabledIcon || disabledIcon || No difference.
 
|-
 
|-
| hoverIcon || hoverIcon || This is coming in 3.3M5.
+
| hoverIcon || hoverIcon || No difference.
 
|-
 
|-
 
| tooltip || tooltip || No difference.
 
| tooltip || tooltip || No difference.
 
|-
 
|-
| helpContextId || helpContextId || This is coming in 3.3M5.
+
| helpContextId || helpContextId || No difference.
 
|-
 
|-
| style || TBD || This is coming in 3.3M5.
+
| style || style || it supports the same styles. Note, radio button is just a style attribute, not a grouping attribute.
 
|-
 
|-
| state || TBD || This is coming in 3.3M5.
+
| state || TBD || This is coming in 3.3M6.
 
|-
 
|-
 
| pulldown || - || This is no longer necessary.
 
| pulldown || - || This is no longer necessary.
Line 91: Line 91:
 
| - || mnemonic || The letter to assign the &amp; to.
 
| - || mnemonic || The letter to assign the &amp; to.
 
|-
 
|-
| selection subelement || enabledWhen subelement || All enablement is done through core expressions.
+
| selection subelement || - || All enablement is done through the active handler core expressions.
 
|-
 
|-
| enablement subelement || enabledWhen subelement || All enablement is done through core expressions.
+
| enablement subelement || - || All enablement is done through the active handler 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.
 
| 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.
 +
|-
 +
| - || visibleWhen subelement || The visibility of each menu or toolbar item is determined declaratively using core expressions.
 
|}
 
|}
 +
 +
 +
Enablement, selection, or visibility mappings from objecContributions to the core expressions.  If working against the current selection, most tests must be within an iterate element.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Element !! Attribute || New Element and Attribute || Comments
 +
|-
 +
| objectContribution || objectClass || instanceof element || Inside an iterate element when used on the current selection.
 +
|-
 +
| objectContribution || nameFilter || propertyTester || There is already a resource property tester provided
 +
|-
 +
| objectContribution || adaptable || adapt || To see if the selection is adapatable use '''adapt''' isntead of '''instanceof'''.
 +
|-
 +
| filter || -  || adapt element || You can specifically adapt each selection to org.eclipse.ui.IActionFilter.  This might be replaced with the test element and propery tester extension point in 3.3M6.
 +
|-
 +
| objectClass || -  || instanceof element || You can test the class of a selection element.
 +
|-
 +
| objectState || -  || adapt element || You can specifically adapt each selection to org.eclipse.ui.IActionFilter.  This might be replaced with the test element and propery tester extension point in 3.3M6.
 +
|-
 +
| pluginState || -  || TBD || this is coming in 3.3M6.
 +
|-
 +
| systemProperty || -  || systemTest element || Test a system property.
 +
|-
 +
| - || -  || with element || changes the object to be inspected for all its child element to the object referneced by the given variable.
 +
|-
 +
| - || -  || equals element || perform an equals check on the object in focus.  Effectively obj.toString().equals(value)
 +
|-
 +
| - || -  || count element || test the number of elements if the current object is a java.util.Collection - like current selection or active contexts.
 +
|}
 +
 +
[[Category:Eclipse Project]]

Latest revision as of 09:06, 2 August 2007

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. In 3.3M5 action sets generate and activate contexts with the same id. Definition decisions will be made in .3.M6
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 command contribution.


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 and it must be named.
<action/> <command/> It has a separate difference table.


Differences between <action/> and <command/>

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 No difference.
hoverIcon hoverIcon No difference.
tooltip tooltip No difference.
helpContextId helpContextId No difference.
style style it supports the same styles. Note, radio button is just a style attribute, not a grouping attribute.
state TBD This is coming in 3.3M6.
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 - All enablement is done through the active handler core expressions.
enablement subelement - All enablement is done through the active handler 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.
- visibleWhen subelement The visibility of each menu or toolbar item is determined declaratively using core expressions.


Enablement, selection, or visibility mappings from objecContributions to the core expressions. If working against the current selection, most tests must be within an iterate element.

Element Attribute New Element and Attribute Comments
objectContribution objectClass instanceof element Inside an iterate element when used on the current selection.
objectContribution nameFilter propertyTester There is already a resource property tester provided
objectContribution adaptable adapt To see if the selection is adapatable use adapt isntead of instanceof.
filter - adapt element You can specifically adapt each selection to org.eclipse.ui.IActionFilter. This might be replaced with the test element and propery tester extension point in 3.3M6.
objectClass - instanceof element You can test the class of a selection element.
objectState - adapt element You can specifically adapt each selection to org.eclipse.ui.IActionFilter. This might be replaced with the test element and propery tester extension point in 3.3M6.
pluginState - TBD this is coming in 3.3M6.
systemProperty - systemTest element Test a system property.
- - with element changes the object to be inspected for all its child element to the object referneced by the given variable.
- - equals element perform an equals check on the object in focus. Effectively obj.toString().equals(value)
- - count element test the number of elements if the current object is a java.util.Collection - like current selection or active contexts.