Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Dropdown in Toolbar(A Toolbar Dropdown is generated but no Menu is shown)
Dropdown in Toolbar [message #736876] Fri, 14 October 2011 08:26
dwestermann is currently offline dwestermann
Messages: 7
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!

Previous Topic:Correct use EModelService.findElements?
Next Topic:Making the e4 pojo programming model accessible from org.eclipse.ui extension points
Goto Forum:
  


Current Time: Fri Apr 18 01:46:19 EDT 2014

Powered by FUDForum. Page generated in 0.01418 seconds