Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Incorrect behavior when only one command is contributed to the root menu
Incorrect behavior when only one command is contributed to the root menu [message #694104] Thu, 07 July 2011 16:02 Go to next message
Eclipse UserFriend
Hi, I have a RCP application and in it's ActionBarAdvisor I create the "root" menu.
protected void fillMenuBar(IMenuManager menuBar) {
    menuBar.add(new MenuManager("File", "file"));
    menuBar.add(new MenuManager("Edit", "edit"));
    menuBar.add(new MenuManager("Window", "window"));
}

Now I contribute a menuContribution with my command
<menuContribution locationURI="menu:edit?after=additions">
    <command commandId="menu.test.rcp.command2" style="push">
        <visibleWhen checkEnabled="true"></visibleWhen>
    </command>
</menuContribution>

and an handler for that command
<handler class="xxx.MyHandler" commandId="menu.test.rcp.command2">
    <activeWhen>
        <with variable="activeEditorId">
            <equals value="myEditorId">
            </equals>
        </with>
    </activeWhen>
</handler>

The problem is, that this doesn't work. The menu "Edit" doesn't show up unless I add any other command to that menu.
After that it works fine.
Does it mean that I can't have menu with only one menu contribution to that menu?
Re: Incorrect behavior when only one command is contributed to the root menu [message #698072 is a reply to message #694104] Mon, 18 July 2011 14:05 Go to previous message
Eclipse UserFriend
Edit is not being created because it is empty. Is the problem that it doesn't appear even when you open your editor with myEditorId?

PW
Previous Topic:handle EditorActions
Next Topic:Passing variables from the runtime code as parameters to command
Goto Forum:
  


Current Time: Sun Aug 31 04:30:38 EDT 2025

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

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

Back to the top