Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Contributing command to popup submenu
Contributing command to popup submenu [message #332159] Tue, 07 October 2008 17:45 Go to next message
Eclipse UserFriend
Originally posted by: bsv.datatel.com

I have a view. This view has a popup menu registered in the default
fashion, e.g. the popup menu ID is the same as the view ID.

This popup menu has a submenu, contributed as a "menu" under an
"objectContribution" on a legacy "popupMenus" extension point. The
"menu" has a unique ID.

There are a couple items on that submenu which are also contributed via
the popupMenus extension point.

Here's the problem. I have a command that I want to contribute to that
same submenu. I'm trying to use the new "menuContribution" element on
the "org.eclipse.ui.menus" extension point. Specifying the locationURI
to the submenu is where I get stuck. I thought it would be:

locationURI="popup:submenuID"

But it doesn't show on the submenu. If I use the view ID, it shows on
the submenu's parent (the main popup menu for the view), as such:

locationURI="popup:viewID"

This proves that the appropriate handler is active and the command is
enabled.

Help with getting it show up on the submenu?

Thanks
Ben
Re: Contributing command to popup submenu [message #332172 is a reply to message #332159] Wed, 08 October 2008 12:23 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The menu contributions (org.eclipse.ui.menus) can't see action
contributions, as they're applied first. Action contributions can see
menu contributions however.

You could simply add the same submenu with the same ID (and whatever
necessary visibleWhen clause to make it like an objectContribution)
using org.eclipse.ui.menus, and then it would be there for your command
as well as the popupMenus.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: Contributing command to popup submenu [message #332177 is a reply to message #332172] Wed, 08 October 2008 14:30 Go to previous message
Eclipse UserFriend
Originally posted by: bsv.datatel.com

Thanks. That did the trick.

Paul Webster wrote:
> The menu contributions (org.eclipse.ui.menus) can't see action
> contributions, as they're applied first. Action contributions can see
> menu contributions however.
>
> You could simply add the same submenu with the same ID (and whatever
> necessary visibleWhen clause to make it like an objectContribution)
> using org.eclipse.ui.menus, and then it would be there for your command
> as well as the popupMenus.
>
> PW
>
Previous Topic:Changing Eclipse preferences programmatically
Next Topic:How to contribute to the Eclipse startup spashscreen?
Goto Forum:
  


Current Time: Wed Jul 03 03:50:56 GMT 2024

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

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

Back to the top