Community
Participate
Working Groups
Version: CVS HEAD Registered context menus on composites no longer show when you right click. Was working in 1.4. Snippet: Composite comp = new Composte(parent, SWT.NONE); MenuManager menuMgr = new MenuManager("#PopupMenu"); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { public void menuAboutToShow(IMenuManager manager) { manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); AddSlotAction addAction = new AddSlotAction(desc); manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, addAction); } }); Menu m = menuMgr.createContextMenu(comp); comp.setMenu(m);
Reproducible with Controls Demo -> Button tab. There is a context menu set on the buttons parent composite.
"menu" is missing from AdapterUtil.js#_controlProperties and AdapterUtil.js#_controlPropertyHandler. More over, WidgetUtilLCA#renderMenu will fail with NPE in case of null menu (resetting menu to null).
Fixed by adding "menu" to AdapterUtil.js#_controlProperties and AdapterUtil.js#_controlPropertyHandler. NPE in WidgetUtilLCA#renderMenu is fixed too. JUnit and JS tests added. Changes are in CVS HEAD.