Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding submenus to custom menus
Adding submenus to custom menus [message #455319] Wed, 20 September 2006 16:34 Go to next message
Eclipse UserFriend
I added a new menu to the menu bar using the following <menu> tag inside a
<actionSet> tag:
<menu id="tasks"
label="Tasks">
<groupMarker name="top"/>
<separator name="separator"/>
<groupMarker name="context"/>
</menu>

The problem is that I can add Actions to this menu, but not submenus. For
example, the following correctly adds an Action to the above menu:
<action
class="(classname)"
id="(idname)"
label="This menu entry shows up!"
menubarPath="tasks/context"
style="push"/>

But this code does NOT add a submenu to the same menu:
<menu
id="addsubtask"
label="Add Subtask"
path="tasks/context">
<groupMarker name="new_custom_task"/>
</menu>

Here, I use the same "path" for my submenu that I use for the
"menubarPath" in the Action. Yet the submenu doesn't appear anywhere when
I do it this way. However, if I remove the "path" field from the tag, then
this submenu shows up as a top-level menu in the menu bar, which is not
what I want either (although it's better than not showing up at all).

I assume that there's something wrong with the way I'm using my "path" and
"menubarPath" fields, but I've tried every permutation I can think of, and
still no luck. I'm convinced that there must be something extremely
simple I'm overlooking. Can anyone give me a clue?

thanks.
Re: Adding submenus to custom menus [message #455321 is a reply to message #455319] Wed, 20 September 2006 17:17 Go to previous messageGo to next message
Eclipse UserFriend
Never mind. The problem was that the Actions that I was adding to the
submenus had the wrong path. I needed to precede their path with the path
to the main menu, instead of just the path to the submenu.

Funny how I wrestled with this for days, and it's not until I post a
question to the newsgroup that I end up figuring it out on my own. :-)

Thanks,
Geoff


On Wed, 20 Sep 2006 14:34:26 -0600, Geoff Draper wrote:

> I added a new menu to the menu bar using the following <menu> tag inside a
> <actionSet> tag:
> <menu id="tasks"
> label="Tasks">
> <groupMarker name="top"/>
> <separator name="separator"/>
> <groupMarker name="context"/>
> </menu>
>
> The problem is that I can add Actions to this menu, but not submenus. For
> example, the following correctly adds an Action to the above menu:
> <action
> class="(classname)"
> id="(idname)"
> label="This menu entry shows up!"
> menubarPath="tasks/context"
> style="push"/>
>
> But this code does NOT add a submenu to the same menu:
> <menu
> id="addsubtask"
> label="Add Subtask"
> path="tasks/context">
> <groupMarker name="new_custom_task"/>
> </menu>
>
> Here, I use the same "path" for my submenu that I use for the
> "menubarPath" in the Action. Yet the submenu doesn't appear anywhere when
> I do it this way. However, if I remove the "path" field from the tag, then
> this submenu shows up as a top-level menu in the menu bar, which is not
> what I want either (although it's better than not showing up at all).
>
> I assume that there's something wrong with the way I'm using my "path" and
> "menubarPath" fields, but I've tried every permutation I can think of, and
> still no luck. I'm convinced that there must be something extremely
> simple I'm overlooking. Can anyone give me a clue?
>
> thanks.
Re: Adding submenus to custom menus [message #460162 is a reply to message #455319] Fri, 15 December 2006 12:13 Go to previous message
Eclipse UserFriend
Originally posted by: rbitton.cisco.com

Hi. I am having the same problem. Could you post your plugin.xml or e-mail it to me at rbitton@cisco.com. I want to create sub menu items through plugin.xml and am not able to do it. Thanks very much.
Previous Topic:Creating sub-menu/actions through plugin.xml
Next Topic:TreeViewer and setSelection slow
Goto Forum:
  


Current Time: Wed Mar 26 17:44:49 EDT 2025

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

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

Back to the top