Bug 396974 - [Contributions] Multiple Parents for MenuContribution item
Summary: [Contributions] Multiple Parents for MenuContribution item
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-20 03:41 EST by Marco Descher CLA
Modified: 2014-02-03 11:41 EST (History)
2 users (show)

See Also:


Attachments
emf xpath integration (382 bytes, text/plain)
2012-12-20 13:07 EST, Paul Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Descher CLA 2012-12-20 03:41:18 EST
In http://www.eclipse.org/forums/index.php/t/441695/ I posted the question wether it is possible to set a MenuContribution on multiple menus via providing multiple parentIds.

After some research I found no evidence that this is possible. If this is really the case then IMHO this is a missing feature.

If for example I want to provide the same subset of menuitems within two different menu items (covering e.g. aspects of user-management add/remove/edit) I have to add two MenuContribution items with different parentIds. The ideal case would be to manage only one contribution allowing it to be hooked to n menus.
Comment 1 Paul Webster CLA 2012-12-20 10:39:16 EST
The pattern for using MenuContributions as they are now is to group your content in one MenuContribution and insert the MMenu with the same id in your 2 locations.

It doesn't work between popup and regular menu, however, as those are different schemes.

One of the things I'm considering (although I doubt it will be in 4.3) is to allow model fragments to 1) be more dynamic in nature and 2) specify them using XPath.  Then specifying specific locations or multiple parent IDs would be possible.

PW
Comment 2 Marco Descher CLA 2012-12-20 12:15:17 EST
Paul, thank you, I understand. This however forces me to introduce menus in the original model instead of linking to already existing menu items. 

I do not understand the approach you mention in 1 or 2, but if you go for a specific way, tell me if i can help!
Comment 3 Paul Webster CLA 2012-12-20 13:07:08 EST
Created attachment 224969 [details]
emf xpath integration

Part 1 would be to look at model fragment processing.  For the existing model, apply fragments at all locations that match their insertion point.  Then for any new additions to the model, be able to evaluate them as well.

Part 2 would be to allow insertion points expressed as XPath.  See this project set file for the 2 bundles that supply EMF-XPath integration.  XPath would be able to specify insertion points more precisely.

PW
Comment 4 Nobody - feel free to take it CLA 2013-02-14 05:23:58 EST
Does this still stand as an enhancement request (Requiring the MC to have multiple parents)?

I'm supposing no but feel free to repoen.
Comment 5 Paul Webster CLA 2013-06-26 10:18:46 EDT
For consideration with bug 324954

PW