Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Having customized forms or Adding Menus/Toolbars/Context Menus and etc. when running GMF as a plugin
Having customized forms or Adding Menus/Toolbars/Context Menus and etc. when running GMF as a plugin [message #1702105] Sun, 19 July 2015 12:06 Go to next message
Eclipse UserFriend
Hi everybody,

Consider that I want build a domain specific modelling tool using GMF. What I found is that when we run GMF project as eclipse plugin, we are still constrained with the environment that GMF provides for you. However, I would like to use GMF modelling functionality but adding some more stuffs like MenuBars, Context Menus or everythingles that I could have in my own developed modelling tool.
For example, in the attached screetshot, they can right click on the model and have their own menu items...

Is that possible, if yes how ... ?

Thanks and Appreciated ... Smile
  • Attachment: mmtf.png
    (Size: 162.39KB, Downloaded 331 times)
Re: Having customized forms or Adding Menus/Toolbars/Context Menus and etc. when running GMF as a pl [message #1702559 is a reply to message #1702105] Thu, 23 July 2015 04:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi Parsa Pourali,

Shhhhhh... this is a TOP SECRET.... Very Happy

Go to your *.diagram plug-in, go to the package xxxxx.diagram.part, and go to the Java Class DiagramEditorContextMenuProvider.java. In this class, go to the buildContextMenu() function and check how works the next code :

menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
menu.appendToGroup("editGroup", deleteAction);

In this point you have access to the Context Menu, from all point of your Diagram Editor Surface... Study how add new actions and Menus some code to study, and decide what actions and submenus do you have include in your Context Menu...

Regards,

[Updated on: Thu, 23 July 2015 07:01] by Moderator

Re: Having customized forms or Adding Menus/Toolbars/Context Menus and etc. when running GMF as a pl [message #1702631 is a reply to message #1702559] Thu, 23 July 2015 12:00 Go to previous messageGo to next message
Eclipse UserFriend
Thanks,
I'll let you know how this secret stuffs worked for me Wink At this moment, it seems to be more complicated than what I thought ! Very Happy

Regards,
Parsa
Re: Having customized forms or Adding Menus/Toolbars/Context Menus and etc. when running GMF as a pl [message #1703695 is a reply to message #1702631] Tue, 04 August 2015 06:09 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

to display your contextual menu, you can use the extension point org.eclipse.ui.menus with the locationUri popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu
You can have an example by looking to https://github.com/bonitasoft/bonita-studio/blob/master/bundles/plugins/org.bonitasoft.studio.diagram.custom/plugin.xml

Regards,
Re: Having customized forms or Adding Menus/Toolbars/Context Menus and etc. when running GMF as a pl [message #1703888 is a reply to message #1703695] Wed, 05 August 2015 11:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi Aurelien,

Thank you so much, the link was a very good starting point for me, it was very helpful.

Also, it may be a long shot, but I'd rather ask, do you know or think that we can have access to the elements of a model. for example, I want to have an action listener on the transition label of a state diagram. So, whenever the user tries to edit the label of a transition in a state machine, I can listen to it and do some code ... not sure , if it is possible in GMF or other modelling frameworks ...

Thanks,
Regards,
Parsa
Re: Having customized forms or Adding Menus/Toolbars/Context Menus and etc. when running GMF as a pl [message #1704014 is a reply to message #1703888] Thu, 06 August 2015 12:33 Go to previous messageGo to next message
Eclipse UserFriend
Hi Parsa,

for new questions, please open a new topic next time. I will answer here this time, if you need more details after my answer, please also open a new thread.

Of course you put listener when editing elements of the model. If you want to listen to semantic model directly you can take a look here . if you want to listen at Diagram level you can use a DiagramEventBroker, there is an example here.

Regards,
Re: Having customized forms or Adding Menus/Toolbars/Context Menus and etc. when running GMF as a pl [message #1704142 is a reply to message #1704014] Fri, 07 August 2015 11:52 Go to previous message
Eclipse UserFriend
Thanks Aurélien,

That's great!

Best Regards,
Parsa
Previous Topic:Split Generated Method
Next Topic:Failed to create part's control - Eclipse GMF
Goto Forum:
  


Current Time: Sat Jul 12 23:21:48 EDT 2025

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

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

Back to the top