|
|
|
|
Re: How to create a pop-up menu [message #513917 is a reply to message #513907] |
Thu, 11 February 2010 16:26 |
Jan Krakora Messages: 477 Registered: December 2009 Location: Prague |
Senior Member |
|
|
Paul Webster wrote on Thu, 11 February 2010 11:09 |
That's because myContributionItemObject appears to be not-visible or
doesn't create any MenuItems. Your submenu is then disabled because it
has nothing in it. What is your contribution item doing?
PW
|
myContributionItemObject is a list of 6 zoom values. But if I right-click and open pop-up menu, there is a "Zoom" item and it's enabled. It goes gray only after I hover on that with mouse.
It's weird. If I use this code:
MenuManager menuManager = new MenuManager();
menuManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
manager.add(myContributionItemObject);
Menu menu = menuManager.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(menuManager, viewer);
It works perfectly except that those 6 zoom values are in root menu. And I want to put them in "Zoom" submenu
[Updated on: Thu, 11 February 2010 16:27] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02901 seconds