Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Extending Papyrus - adding a new command to a papyrus menu
Extending Papyrus - adding a new command to a papyrus menu [message #896930] Fri, 20 July 2012 13:16 Go to next message
Mahmut Kafkas is currently offline Mahmut Kafkas
Messages: 2
Registered: July 2012
Junior Member
Hi,

I want to develop a plugin to add new functionality while working with papyrus.

Assume user creates a State Diagram, drags/drop some states and transitions. Now for example, when s/he right clicks a state, I want to add a new command on the popped menu.

I searched for the extension points and identifiers. However, I couldnt find something useful.

Am I on the right path? or How do you think this can be done?

Thanks.

Re: Extending Papyrus - adding a new command to a papyrus menu [message #897196 is a reply to message #896930] Mon, 23 July 2012 06:42 Go to previous messageGo to next message
Alexandra Bardiau is currently offline Alexandra Bardiau
Messages: 21
Registered: March 2012
Junior Member
Maybe this could be helpful:

www.eclipsepluginsite.com/
Re: Extending Papyrus - adding a new command to a papyrus menu [message #897204 is a reply to message #897196] Mon, 23 July 2012 07:02 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 456
Registered: February 2011
Senior Member
Hello,

Papyrus relies on the standard Eclipse menu extension point for all its menus and toolbars: org.eclipse.ui.menus

Have a look at org.eclipse.papyrus.uml.diagram.menu for some examples.

Papyrus also provides a property tester for testing the Diagram Type: org.eclipse.papyrus.uml.diagram.common.diagram.tester.diagramType (Have a look at org.eclipse.papyrus.uml.diagram.composite for an example)


Regards,
Camille


Camille Letavernier
Papyrus developer
Re: Extending Papyrus - adding a new command to a papyrus menu [message #897209 is a reply to message #897204] Mon, 23 July 2012 08:23 Go to previous messageGo to next message
LE HALPER Nicolas is currently offline LE HALPER Nicolas
Messages: 13
Registered: April 2012
Junior Member
Here is an Eclipse Commands Tutorial.

www.vogella.com/articles/EclipseCommands/article.html

I think you might achieve something with it, especially with the seventh part : Tutorial: Commands and context menus which could be useful in your case.

Nicolas

[Updated on: Mon, 23 July 2012 08:23]

Report message to a moderator

Re: Extending Papyrus - adding a new command to a papyrus menu [message #903219 is a reply to message #896930] Wed, 22 August 2012 14:51 Go to previous message
Mahmut Kafkas is currently offline Mahmut Kafkas
Messages: 2
Registered: July 2012
Junior Member
Thanks Camille and Nicolas,

Solution:
As Camille said, I dig into the source code of "org.eclipse.papyrus.uml.diagram.menu" and found how papyrus team implemented the context views and commands such as "Format" and "Filter" by searching the extention points and locationURIs in the plugin.xml file.

For instance, the locationURI for adding a command in the context menu after right click in a papyrus diagram is "popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu"

Regards.
Mahmut

Previous Topic:Patterns to catch Papyrus UI contributions
Next Topic:Installing Papyrus
Goto Forum:
  


Current Time: Thu Sep 18 11:45:41 GMT 2014

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

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