Skip to main content



      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 09:16 Go to next message
Eclipse UserFriend
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 02:42 Go to previous messageGo to next message
Eclipse UserFriend
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 03:02 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Extending Papyrus - adding a new command to a papyrus menu [message #897209 is a reply to message #897204] Mon, 23 July 2012 04:23 Go to previous messageGo to next message
Eclipse UserFriend
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 04:23] by Moderator

Re: Extending Papyrus - adding a new command to a papyrus menu [message #903219 is a reply to message #896930] Wed, 22 August 2012 10:51 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 19:15:36 EDT 2025

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

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

Back to the top