Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Adding a context menu entry in the model editor
Adding a context menu entry in the model editor [message #643321] Mon, 06 December 2010 14:02 Go to next message
Haffi is currently offline HaffiFriend
Messages: 39
Registered: November 2010
Member
Hi,

I'd like to add a new context menu entry in the model editor (e.g. when right clicking a class in the editor). Is there any way to do this? I've found an extension point (actionHandler) but I've got no idea on how to use it.
Re: Adding a context menu entry in the model editor [message #643454 is a reply to message #643321] Mon, 06 December 2010 22:32 Go to previous messageGo to next message
Wojciech Trocki is currently offline Wojciech TrockiFriend
Messages: 64
Registered: May 2010
Member
There is two ways to do this.
The simplest is to use provided extension point.

You can always read extension point description from plugin editor. ( If developers specify it)

Just select extension point and click something like "show extension point description" located on the right.

You can also search in documentation for ActionHandler.

http://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.papy rus/trunk/doc//DevelopperDocuments/extensionPoints

Good day
Re: Adding a context menu entry in the model editor [message #643544 is a reply to message #643454] Tue, 07 December 2010 10:48 Go to previous messageGo to next message
Haffi is currently offline HaffiFriend
Messages: 39
Registered: November 2010
Member
Hi,

Thanks for your reply. I've read the documentation and I'm still not sure if this is the extension point that provides me with the possibility of adding a context menu in the editor. I hope someone can clarify this for me.
Re: Adding a context menu entry in the model editor [message #643553 is a reply to message #643544] Tue, 07 December 2010 11:31 Go to previous messageGo to next message
Wojciech Trocki is currently offline Wojciech TrockiFriend
Messages: 64
Registered: May 2010
Member
This extension point is depreciated.
I think that you sould use org.eclipse.actions to contribute menu item.
How to do this. Look into great tutorials on lars vogella site:
http://www.vogella.de

To obtain location uri you should use shift+alt+f2 shortcut in eclipse.
Re: Adding a context menu entry in the model editor [message #643569 is a reply to message #643553] Tue, 07 December 2010 13:38 Go to previous messageGo to next message
Haffi is currently offline HaffiFriend
Messages: 39
Registered: November 2010
Member
Yes, it seems that this is the way to go. Vogella has a good tutorial on this but I can't seem to find the URI for the context menu. Pressing Alt+Shift+F3 in the editor gives me the URI org.eclipse.papyrus.editor but I guess that's not enough to identify the context menu.
Re: Adding a context menu entry in the model editor [message #643690 is a reply to message #643569] Tue, 07 December 2010 21:05 Go to previous message
Wojciech Trocki is currently offline Wojciech TrockiFriend
Messages: 64
Registered: May 2010
Member
.I try to fetch this location for you and is not possible to use it.
Papyrus context menu uri has null location. Maybe this is a bug. I think that context menu is based on soruce code rather than xml configuration.
You should look to source code, and seek how this context menu is implemented. I'm not sure because I'm new in papyrus like you. Maybe others can help Grin

Let me know if you found a solution.

[Updated on: Tue, 07 December 2010 21:06]

Report message to a moderator

Previous Topic:Thanks for great job.
Next Topic:Double default palette?
Goto Forum:
  


Current Time: Fri Aug 14 18:50:42 GMT 2020

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

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

Back to the top