How to contribute a new command into a sub-context menu? [message #492900] |
Thu, 22 October 2009 09:56 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
I have two plugins. In the first I declared a command with a parameter
and some menu contributions for that command in the context menu of a
generated EMF editor. The schema looks like this:
<extension point="org.eclipse.ui.commands">
<command
defaultHandler="my.TransformationHandler"
id="my.command.transform"
name="CRUISeTransform">
<commandParameter
id="my.command.transform.param"
name="Transformation File"
optional="false"
typeId="my.converter.id.URI">
</commandParameter>
</command>
<commandParameterType
converter="my.URIConverter"
id="my.converter.id.URI"
type="org.eclipse.emf.common.util.URI">
</commandParameterType>
</extension>
<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:my.generated.MetaModelEditorID?before=additions ">
<menu
label="My Transformations">
<command
commandId="my.command.transform"
label="Generate Something"
style="push">
<parameter
name="my.command.transform.param"
value="theValue">
</parameter>
</command>
</menu>
</menuContribution>
</extension>
And the second plugin: Here I want to add a new entry in the sub-context
menu which was contributed in the first plugin. But the problem I see is
the following. When adding a new menuContribution to
org.eclipse.ui.menus I only can specify the locationURI of the parent
context menu, isn't it? That means in this case I only can a new
contribution to "popup:my.generated.MetaModelEditorID" but not to the
first created sub-context menu named "My Transformations". Am I
understandable and can you help me?
|
|
|
Re: How to contribute a new command into a sub-context menu? [message #492904 is a reply to message #492900] |
Thu, 22 October 2009 10:20 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
I found out something:
> <menu
> label="My Transformations">
If I add an id here it can be used to specify a contribution path as the
tooltip told me ;)
So I added id="transformationsMenu" to the sub-context menu. But I'm
still not successful with the following locationURI in the second plugin:
locationURI=" popup:popup:my.generated.MetaModelEditorID/transformationsMe nu "
Can you please help me?
|
|
|
|
|
Re: How to contribute a new command into a sub-context menu? [message #493161 is a reply to message #493144] |
Fri, 23 October 2009 12:42 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Thanks for the idea Christian, but unfortunately it doesn't work :(
> have you tried putting a invisible speparator into the submenu...
> giving the seperator an id and then use that id in the uri..
>
> i.e. menu has ida A
> submenu contains sperator with id B
> then
> uri: popup:A?after=B
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03500 seconds