Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Creating elements in the diagram statically
Creating elements in the diagram statically [message #1002460] Fri, 18 January 2013 16:16 Go to next message
Philipp El is currently offline Philipp El
Messages: 14
Registered: September 2012
Junior Member
Hi,

i have created a gmf project like at the following image can be seen:
index.php/fa/13016/0/

Now there are two questions:

What needs to be changed in the source code so that the individual elements (files, folders) can be created statically via a button?
How needs the source code of the GUI to be adjusted so that a button appears in the palette?

Thank you very much!

Best regards,

Philipp

[Updated on: Fri, 18 January 2013 16:18]

Report message to a moderator

Re: Creating elements in the diagram statically [message #1002719 is a reply to message #1002460] Sat, 19 January 2013 08:02 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

the method managePalette in this template does the job of creating a model element in the Palette: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/templates/aspects/xpt/editor/Editor.xpt . I did put some code for intialization into the ElementInitializer http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/templates/aspects/xpt/providers/ElementInitializers.xpt#108 You could also modify the create command to take the selected tool into account.

Ralph
Re: Creating elements in the diagram statically [message #1007570 is a reply to message #1002719] Wed, 06 February 2013 14:33 Go to previous messageGo to next message
Philipp El is currently offline Philipp El
Messages: 14
Registered: September 2012
Junior Member
Hi Ralph,

thank you very much for your response.
But i need changes in the generated code which the GMF framework has generated, not changes in the framework.
I think i have to change the code in the XXX.diagram project. But I'm not sure which classes or methods i have to change.

Best regards,

Philipp
Re: Creating elements in the diagram statically [message #1007724 is a reply to message #1007570] Thu, 07 February 2013 10:19 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi Philipp,

the thing is that you will get in trouble when changing the generated template instead of using custom templates or extension points. For every class in the templates you will find a corresponding generated class. Just take a look for the class name in the templates and search for it. You will find the generated classes.

Ralph
Re: Creating elements in the diagram statically [message #1007778 is a reply to message #1007724] Thu, 07 February 2013 13:36 Go to previous messageGo to next message
Philipp El is currently offline Philipp El
Messages: 14
Registered: September 2012
Junior Member
Hi Ralph,

do you mean that i have not the change the generated source code from GMF but the Xpand templates in the GMF framework?
If this is the case, how will the Xpand templates be included? Sorry for this beginner question but I'm new in Xpand.
Thank you very much.

Best regards,

Philipp
Re: Creating elements in the diagram statically [message #1007809 is a reply to message #1002460] Thu, 07 February 2013 15:01 Go to previous message
Daniel König is currently offline Daniel König
Messages: 24
Registered: November 2012
Junior Member
Hey Philipp!

Follow the steps from the following link:
http://www.bonitasoft.org/blog/eclipse/customize-your-gmf-editor-by-customizing-templates/

There are a lot of examples at the SVN from Bonita Open Solution:
http://www.bonitasoft.org/websvn/listing.php?repname=Bonita+Open+Solution&path=%2Fbonita-studio%2Ftrunk%2Fplugins%2Forg.bonitasoft.studio-models%2FGMFTemplates%2Faspects%2Fimpl%2Fdiagram%2Feditparts%2F#path_bonita-studio_trunk_plugins_org.bonitasoft.studio-models_GMFTemplates_aspects_impl_diagram_editparts_

Good luck! Smile
Previous Topic:Split connection between two nodes when placing a new node on the connection
Next Topic:How to customize the appearance of an XML object
Goto Forum:
  


Current Time: Thu Oct 30 12:15:53 GMT 2014

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

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