Community
Participate
Working Groups
I found that on Eclipse 3.1.1 and 3.2M5a popupMenus do not show menus created via the popupMenus extension via an objectContribution unless a menu action was first placed in the menu manager via code. I did not test this on any other OS. If I create a popupMenu in a View like this: MenuManager contextMenuMgr = new MenuManager("#PopupMenu"); Action action = new Action() { public void run() { ; } }; action.setText("Why does this have to be here to see other menus?"); // contextMenuMgr.add(action); contextMenuMgr.add( new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); Menu menu = contextMenuMgr.createContextMenu( this.treeViewer.getControl()); this.treeViewer.getControl().setMenu(menu); this.getSite().registerContextMenu(contextMenuMgr, this.treeViewer); And have plugin.xml like this: <extension point="org.eclipse.ui.popupMenus"> <objectContribution id="com.xyz.C1" objectClass="java.lang.String"> <menu id="com.xyz.xyzMenu" label="Menu" path="additions"> <separator name="group1"/> </menu> <action class="com.xyz.action.NewAction" id="com.xyz.actions.menuAction" label="Action in Menu" menubarPath="com.xyz.xyzMenu/group1"/> <action class="com.xyz.action.NewAction" id="com.xyz.actions.additionAction" label="Action in Additions" menubarPath="additions"/> </objectContribution> </extension> I will not see the menu lableled 'Menu' and thus be missing the action labeled 'Action in Menu'. But I will see the action labeled 'Action in Additions'. However if I uncomment the line in the above code contextMenuMgr.add(action); I will see the menu, it's action and the other action.
I believe this is duplicate of Bug 128293. Could you try making the change in Bug 128293 comment #4, and let me know if it works for you?
If you mean for me to rebuild the org.eclipse.jface_3.2....jar using that fix, then yes, it does work for me. I'm not sure how other developers are going to get this fix into their dev environments. I tried making a fragment for org.eclipse.jface and including that fragment during the PDE startup of my RCP but that didn't have the desired effect. But I guess this is my problem now. Is it too late to get this SubMenuManager fix into 3.2? Thanks Doug FYI: Marking this bug as dup of 128293 *** This bug has been marked as a duplicate of 128293 ***
There will almost definitely be a fix for 3.2. I'm just trying to move cautiously, as this is one of those "brittle" areas in the workbench layer. (A lot of downstream code depend on this code working in a very particular way.)