Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356219 - [Protocol] Context menu does not show for Composite
Summary: [Protocol] Context menu does not show for Composite
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: 1.5 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-30 11:43 EDT by Austin Riddle CLA
Modified: 2011-08-31 03:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.