Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Adding a menu entry to the UML Editor Menu
Adding a menu entry to the UML Editor Menu [message #477088] Wed, 12 March 2008 21:51 Go to next message
Felix Dorner is currently offline Felix Dorner
Messages: 675
Registered: July 2009
Senior Member
Hey,

When I open an uml file with the UML tree editor, the main menu bar is
populated with a menu "UML Editor". For a few hours now (yeah I bite..)
I try to extend that menu from inside my plugin. I try to do so via the
org.eclipse.ui.menu extension point like this:

<menuContribution
locationURI=" menu:org.eclipse.uml2.umlMenuID?after=org.eclipse.uml2.uml.e ditor.ElementMenuID ">
<menu
label="hahhahaha">
<command
commandId="allure.commands.generate"
label="huhuhu"
style="push">
</command>
</menu>
</menuContribution>


I also tried ..?after=additions, but that didn't work either. Is this
even possible?


Felix
Re: Adding a menu entry to the UML Editor Menu [message #477093 is a reply to message #477088] Thu, 13 March 2008 10:13 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Felix,

Have a look at the source code in org.eclipse.uml2.examples.uml.ui.
Inspect the plugin.xml.

You will see some menu items being contributed like the following ...
<action
label="%_UI_EcoreModelAction_label"

class=" org.eclipse.uml2.examples.uml.ui.actions.ConvertToEcoreModel Action "

menubarPath=" org.eclipse.uml2.umlMenuID/org.eclipse.uml2.examples.uml.ui. ConvertToMenuID/additions "

enablesFor="1"

id=" org.eclipse.uml2.examples.uml.ui.ConvertToEcoreModelActionID ">

<enablement>

<objectClass

name="org.eclipse.uml2.uml.Package">

</objectClass>

</enablement>

</action>


That xml file should indicate how to add to the menus.
I've attached it to this response.

Good luck ... and don't feel bad... I also have issues with menus :)

Cheers,
- James.


"Felix Dorner" <felix_do@web.de> wrote in message
news:fra1ai$not$1@build.eclipse.org...
> Hey,
>
> When I open an uml file with the UML tree editor, the main menu bar is
> populated with a menu "UML Editor". For a few hours now (yeah I bite..)
> I try to extend that menu from inside my plugin. I try to do so via the
> org.eclipse.ui.menu extension point like this:
>
> <menuContribution
> locationURI=" menu:org.eclipse.uml2.umlMenuID?after=org.eclipse.uml2.uml.e ditor.ElementMenuID ">
> <menu
> label="hahhahaha">
> <command
> commandId="allure.commands.generate"
> label="huhuhu"
> style="push">
> </command>
> </menu>
> </menuContribution>
>
>
> I also tried ..?after=additions, but that didn't work either. Is this
> even possible?
>
>
> Felix


  • Attachment: plugin.xml
    (Size: 9.16KB, Downloaded 53 times)
Re: Adding a menu entry to the UML Editor Menu [message #477094 is a reply to message #477093] Thu, 13 March 2008 11:23 Go to previous message
Felix Dorner is currently offline Felix Dorner
Messages: 675
Registered: July 2009
Senior Member
James, thanks a lot. I had the examples plugin in my workspace all the
time... I am just confused about all those extension points, but I guess
its normal in the beginning...

Felix

James Bruck wrote:
> Hi Felix,
>
> Have a look at the source code in org.eclipse.uml2.examples.uml.ui.
> Inspect the plugin.xml.
>
Re: Adding a menu entry to the UML Editor Menu [message #626222 is a reply to message #477088] Thu, 13 March 2008 10:13 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Felix,

Have a look at the source code in org.eclipse.uml2.examples.uml.ui.
Inspect the plugin.xml.

You will see some menu items being contributed like the following ...
<action
label="%_UI_EcoreModelAction_label"

class=" org.eclipse.uml2.examples.uml.ui.actions.ConvertToEcoreModel Action "

menubarPath=" org.eclipse.uml2.umlMenuID/org.eclipse.uml2.examples.uml.ui. ConvertToMenuID/additions "

enablesFor="1"

id=" org.eclipse.uml2.examples.uml.ui.ConvertToEcoreModelActionID ">

<enablement>

<objectClass

name="org.eclipse.uml2.uml.Package">

</objectClass>

</enablement>

</action>


That xml file should indicate how to add to the menus.
I've attached it to this response.

Good luck ... and don't feel bad... I also have issues with menus :)

Cheers,
- James.


"Felix Dorner" <felix_do@web.de> wrote in message
news:fra1ai$not$1@build.eclipse.org...
> Hey,
>
> When I open an uml file with the UML tree editor, the main menu bar is
> populated with a menu "UML Editor". For a few hours now (yeah I bite..)
> I try to extend that menu from inside my plugin. I try to do so via the
> org.eclipse.ui.menu extension point like this:
>
> <menuContribution
> locationURI=" menu:org.eclipse.uml2.umlMenuID?after=org.eclipse.uml2.uml.e ditor.ElementMenuID ">
> <menu
> label="hahhahaha">
> <command
> commandId="allure.commands.generate"
> label="huhuhu"
> style="push">
> </command>
> </menu>
> </menuContribution>
>
>
> I also tried ..?after=additions, but that didn't work either. Is this
> even possible?
>
>
> Felix


  • Attachment: plugin.xml
    (Size: 9.16KB, Downloaded 35 times)
Re: Adding a menu entry to the UML Editor Menu [message #626223 is a reply to message #477093] Thu, 13 March 2008 11:23 Go to previous message
Felix Dorner is currently offline Felix Dorner
Messages: 675
Registered: July 2009
Senior Member
James, thanks a lot. I had the examples plugin in my workspace all the
time... I am just confused about all those extension points, but I guess
its normal in the beginning...

Felix

James Bruck wrote:
> Hi Felix,
>
> Have a look at the source code in org.eclipse.uml2.examples.uml.ui.
> Inspect the plugin.xml.
>
Previous Topic:Problems with profile "file:" URI in UML Model Editor
Next Topic:set feature of stereotype
Goto Forum:
  


Current Time: Tue Jul 22 03:40:16 EDT 2014

Powered by FUDForum. Page generated in 0.02627 seconds