Community
Participate
Working Groups
Turn on all action sets. Run the attached code snippet. Notice that findMenuUsingPath does not work for menus created by action sets. The Workbench MenuManager includes ActionSetContributionItems, which are subcontribution items which wrap MenuManagers. The findMenuUsingPath code does not take this into account. I believe the find code should be something like the following. String id = path; String rest = null; int separator = path.indexOf('/'); if (separator != -1) { id = path.substring(0, separator); rest = path.substring(separator + 1); } IContributionItem item = super.find(id); IMenuManager menu = null; MenuManager manager = null; if (item instanceof MenuManager) { manager = (MenuManager) item; if (rest != null) { menu = manager.findMenuUsingPath(rest); } else { menu = manager; } } else if (item instanceof SubContributionItem) { SubContributionItem subContributionItem = (SubContributionItem)item; IContributionItem innerItem = subContributionItem.getInnerItem(); if (innerItem instanceof MenuManager) { manager = (MenuManager)innerItem; if (rest != null) { menu = manager.findMenuUsingPath(rest); } else { menu = manager; } } } else { return null; } return menu;
Simon, could you comment on this? I can fix it up if necessary, but I wanted to double check that my assumptions are correct.
Created attachment 4896 [details] test case
Lynne, is there a known problem in Eclipse that is related to this? Or is it just something you found while looking at the code? If the latter, then I rather wait a while. We are looking into reworking the action contribution story. Current implementation is way to complicated, not to mention "fragile"!
No it's not causing a problem. I worked around it for changes I am doing to Customize Perspective, so there is no rush to fix this now.
Moving Dougs bugs
Assigning to component owner PW
This item has been fixed/superceded by the menu contribution mechanism - bug 154130