Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Dropdown ToolItems don't show Menu
Dropdown ToolItems don't show Menu [message #990473] Wed, 12 December 2012 16:09 Go to next message
Marko Herchet is currently offline Marko HerchetFriend
Messages: 11
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?
Re: Dropdown ToolItems don't show Menu [message #990992 is a reply to message #990473] Sun, 16 December 2012 13:34 Go to previous messageGo to next message
Sopot Cela is currently offline Sopot CelaFriend
Messages: 597
Registered: December 2010
Senior Member

What's your SDK and tools build ID? Not long ago I wrote something similar and it worked IIRC.
Re: Dropdown ToolItems don't show Menu [message #991056 is a reply to message #990992] Mon, 17 December 2012 08:48 Go to previous messageGo to next message
Marko Herchet is currently offline Marko HerchetFriend
Messages: 11
Registered: May 2012
Junior Member
Iam using the Platform Runtime Repo (category: Platform Runtime Binary) from 4.2 release build (http://download.eclipse.org/eclipse/downloads/drops4/R-4.2-201206081400/) in my target platform and the Eclipse SDK for Windows from the same version for developing the application. Iam not sure what you mean by "tools".
SDK says:
Java Development Tools build ID is I20120608-1400
org.eclipse.e4.tools version is 0.12.0.v20120529-2033

[Updated on: Mon, 17 December 2012 08:49]

Report message to a moderator

Re: Dropdown ToolItems don't show Menu [message #991065 is a reply to message #991056] Mon, 17 December 2012 09:13 Go to previous message
Sopot Cela is currently offline Sopot CelaFriend
Messages: 597
Registered: December 2010
Senior Member

Please provide a zip with a minimal example so we can reproduce this
Previous Topic:Difference in children of CTabFolder --> CTabFolder.getChildren()
Next Topic:Issues with Kepler M4 and E4 Tools
Goto Forum:
  


Current Time: Mon Dec 22 13:41:03 GMT 2014

Powered by FUDForum. Page generated in 0.02811 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software