Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 20:02 Go to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
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 18:05 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Mon May 13 09:43:41 GMT 2024

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

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

Back to the top