Dropdown in Toolbar [message #736876] |
Fri, 14 October 2011 12:26 |
Missing name Mising name Messages: 10 Registered: September 2011 |
Junior Member |
|
|
I want to create a Toolbar Dropdown like the "New" Dropdown in Eclipse. The Dropdown should be contributed via a Processor. The Dropdown Menu, a Button with a small arrow on the right, is generated but if I click on the arrow, there is no menu. this is my code:
MDirectMenuItem menuItem = MMenuFactory.INSTANCE.createDirectMenuItem();
menuItem.setLabel("Label");
MToolBar elem=(MToolBar)eservice.find("toolbar:org.eclipse.ui.main.toolbar",application);
MMenu toolMenu = MMenuFactory.INSTANCE.createMenu();
toolMenu.setLabel("Test");
MDirectToolItem toolItem=MMenuFactory.INSTANCE.createDirectToolItem();
elem.getChildren().add(toolItem);
toolItem.setMenu(toolMenu);
toolMenu.getChildren().add(menuItem);
There is a bug report 356309 stating that a static Dropdown Menu isnt shown, is the dynamic menu not shown for the same reason?
In the bug report a workaround "force the rendering engine to create the widget for the menu" is mentioned, how do I this? A snippet would be very helpfull.
Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.03189 seconds