Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » org.eclipse.ui.menus ext point problem
org.eclipse.ui.menus ext point problem [message #641592] Fri, 26 November 2010 04:02 Go to next message
Marko Tomljenovic is currently offline Marko Tomljenovic
Messages: 62
Registered: July 2009
Member
Hello
I want to add a popup menu to an existing popup menu.

The existing popup menu is using the old style org.eclipse.ui.popupMenus extension point.

I want to use the new style org.eclipse.ui.menus extension point to be able to use commands.

But I have tried every combination of menu ids and queries I can imagine. But nothing helped.

Here is the object contribution declaration I want to add my command to:

<objectContribution
id="org.eclipse.cdt.ui.cresources.contrib"
objectClass="org.eclipse.cdt.core.model.ICElement">
<action
class="org.eclipse.cdt.internal.ui.actions.FreshenIndexAction "
id="org.eclipse.cdt.ui.updateIndexAction"
label="%FreshenIndex.name"
menubarPath="org.eclipse.cdt.ui.indexmenu/update">
</action>
<menu
id="org.eclipse.cdt.ui.indexmenu"
label="%Index.menu"
path="buildGroup">
<separator
name="update">
</separator>
</menu>
</objectContribution>


Is there any description on how to do that?

Help would be really appreciated

Greets Marko

Re: org.eclipse.ui.menus ext point problem [message #641978 is a reply to message #641592] Mon, 29 November 2010 07:21 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6850
Registered: July 2009
Location: Ottawa
Senior Member

First of all, check out the following links:

http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions

There's an objectContribution in the examples section of Menu_Contributions.

Marko Tomljenovic wrote:
> But I have tried every combination of menu ids and queries I can
> imagine. But nothing helped.
> Here is the object contribution declaration I want to add my command to:
>
> <objectContribution
> id="org.eclipse.cdt.ui.cresources.contrib"
> objectClass="org.eclipse.cdt.core.model.ICElement">
> <action
>
> class="org.eclipse.cdt.internal.ui.actions.FreshenIndexAction "
> id="org.eclipse.cdt.ui.updateIndexAction"
> label="%FreshenIndex.name"
> menubarPath="org.eclipse.cdt.ui.indexmenu/update">
> </action>
> <menu
> id="org.eclipse.cdt.ui.indexmenu"
> label="%Index.menu"
> path="buildGroup">
> <separator
> name="update">
> </separator>
> </menu>
> </objectContribution>
>

Your locationURI would be popup:org.eclipse.ui.popup.any (see MenuUtil
for supported locationURIs)

Give the example a whirl, and let us know how it goes.

PW

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


Previous Topic:Subversion url and revision number of a file in workspace
Next Topic:Contributing the extension point programatically
Goto Forum:
  


Current Time: Sun Apr 20 15:49:27 EDT 2014

Powered by FUDForum. Page generated in 0.11390 seconds