Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356219

Summary: [Protocol] Context menu does not show for Composite
Product: [RT] RAP Reporter: Austin Riddle <austin.riddle>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: 1.5   
Target Milestone: 1.5 M2   
Hardware: All   
OS: All   
Whiteboard:

Description Austin Riddle CLA 2011-08-30 11:43:23 EDT
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);
Comment 1 Ivan Furnadjiev CLA 2011-08-30 12:03:23 EDT
Reproducible with Controls Demo -> Button tab. There is a context menu set on the buttons parent composite.
Comment 2 Ivan Furnadjiev CLA 2011-08-30 12:21:11 EDT
"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).
Comment 3 Ivan Furnadjiev CLA 2011-08-31 03:22:37 EDT
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.