Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Re: Contribute command to existing menu?
Re: Contribute command to existing menu? [message #468382] Wed, 05 August 2009 10:40 Go to next message
Eclipse UserFriend
Originally posted by: formatzeh.gmx.de

Can't anynone give me a hint? Is the following the right approach for
adding a command to an existing menu? Especially I want to add the
command as a menu entry in the "Generator" menu in the main menu.

Gilbert Mirenque wrote:
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
>
> locationURI=" menu:org.eclipse.emf.codegen.ecore.genmodelMenuID?after=addi tions ">
> <command
> commandId="my.plugin.emf.extended.commands.sampleCommand"
> id="my.plugin.emf.extended.menus.sampleCommand"
> mnemonic="S">
> </command>
> </menuContribution>
> </extension>
Re: Contribute command to existing menu? [message #468391 is a reply to message #468382] Wed, 05 August 2009 11:38 Go to previous message
Thomas Haskes is currently offline Thomas HaskesFriend
Messages: 147
Registered: July 2009
Senior Member
Hi Gilbert,

i think that should work, I did the same way, maybe you forgot to
specify a Handler for your command. Have a look at the command extension
point where you specified the command, it should look like this:

<extension
point="org.eclipse.ui.commands">
<command
defaultHandler=
"handlerClass"
description="a Command"
id="some.command.id"
name="CommandName">
</command>
</extension>

You should at least have a defaultHanlder specified in your command. The
class has to extend org.eclipse.core.commands.AbstractHandler.

HTH

Tom

Gilbert Mirenque schrieb:
> Can't anynone give me a hint? Is the following the right approach for
> adding a command to an existing menu? Especially I want to add the
> command as a menu entry in the "Generator" menu in the main menu.
>
> Gilbert Mirenque wrote:
>> <extension
>> point="org.eclipse.ui.menus">
>> <menuContribution
>>
>> locationURI=" menu:org.eclipse.emf.codegen.ecore.genmodelMenuID?after=addi tions ">
>> <command
>> commandId="my.plugin.emf.extended.commands.sampleCommand"
>> id="my.plugin.emf.extended.menus.sampleCommand"
>> mnemonic="S">
>> </command>
>> </menuContribution>
>> </extension>
>
Previous Topic:Different CellEditor per Row
Next Topic:Re: Plugin not activated/View not shown
Goto Forum:
  


Current Time: Thu Apr 25 08:52:12 GMT 2024

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

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

Back to the top