Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Context Menu in GMF
Context Menu in GMF [message #530926] Sun, 02 May 2010 17:15 Go to next message
Eclipse UserFriend
Hi,
I want to add a Context Menu when i right click on an ellipse.
Can anyone tell me how to do it cause i don't know how to use context menu in GMF?

Thx in advance.

Asma
Re: Context Menu in GMF [message #531210 is a reply to message #530926] Tue, 04 May 2010 04:13 Go to previous messageGo to next message
Eclipse UserFriend
Hello!

Contextual menu under eclipse are not dependent on GMF, they are managed by the tools of development for eclipse plug in.
I recommend you to read this documentation :
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench_basicext_popupMenus.htm

Regards!
Re: Context Menu in GMF [message #531332 is a reply to message #530926] Tue, 04 May 2010 10:46 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

there are some other feature for popup menu in gmf, take a look at:
org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders


Regards,
Re: Context Menu in GMF [message #531374 is a reply to message #531332] Tue, 04 May 2010 12:20 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
Thank u for replying my question.

So, if i understand, i need to add an extension point to my project in which i add the context menu right?

So, why in the definition of the gmftool file, i can find "Context Menu" and how to use it?

and if it's possible, is there any tutoriel on how to add a popup menu extension point because the examples in the Eclipse Help are not clear.

Thanks in advance.
Re: Context Menu in GMF [message #531804 is a reply to message #530926] Thu, 06 May 2010 05:19 Go to previous message
Eclipse UserFriend
I agree with you, the tutorial on the addition of a pop-up menu (tutorial part 3 : Custom Actions) is not clear. I understood how to implement it with the documentation of org.eclipse.ui.popupMenus.

It is necessary to add an extension point to the plugin.xml file of your editor and to configure it. Then it's necessary to create the class object contribution file corresponding which implements IObjectActionDelegate. Then it is necessary to code the action to be realized in the method not implemented "void run(IAction action)".
It is well enough explained in the documentation of org.eclipse.ui.popupMenus.

But I think that the alternative extension point in gmf which proposes Aurelien could be an interesting way. I tried to open a sub-diagram by means of a pop-up menu, I'm maybe going to success there with that.
Previous Topic:How to create views on a diagram (MVC pattern in GMF)
Next Topic:integration OCL validation in EMF generated editor
Goto Forum:
  


Current Time: Thu Aug 28 05:23:31 EDT 2025

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

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

Back to the top