| Dropdown ToolItems don't show Menu [message #990473] |
Wed, 12 December 2012 11:09  |
Marko Herchet Messages: 10 Registered: May 2012 |
Junior Member |
|
|
Hi,
I am dynamically creating a MDirectToolItem with a menu for my Part-Toolbar (no difference when using main-toolbar)
MDirectToolItem item = createDirectToolItem("any"); //$NON-NLS-1$
MMenu menu = MMenuFactory.INSTANCE.createMenu();
menu.setVisible(true);
menu.setToBeRendered(true);
menu.getChildren().add(createDirectMenuItem("other")); //$NON-NLS-1$
item.setMenu(menu);
m_Part.getToolbar().getChildren().add(item);
private MDirectMenuItem createDirectMenuItem(String strID)
{
MDirectMenuItem menuItem = MMenuFactory.INSTANCE.createDirectMenuItem();
menuItem.setLabel("anyLabel");
TestHandler th = new TestHandler();
menuItem.setObject(th);
URL iconURL = FileLocator.find(...); //$NON-NLS-1$ //$NON-NLS-2$
if(iconURL != null){
menuItem.setIconURI(iconURL.toString());
}
menuItem.setToBeRendered(true);
menuItem.setVisible(true);
menuItem.setElementId(strID);
return menuItem;
}
and the renderer creates a toolItem with the dropdown-arrow in the toolbar but clicking on the arrow does not have any effect.
I know there are bugs existing in the MenuRenderers regarding adding/removing Items at runtime, so I closed my application and started it again to directly create the toolitem from the serialized workbench-model but the arrow of the toolitem was still not clickable.
Is this a known bug or am I doing smth wrong?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01715 seconds