Is it possible to generate XML file from Shape example in GEF,Same as its getting generated in GMF? Like in GMF if we select GMF Design page and open it with XML file,it provides all external information about model figures,same like i want to generate with GEF.
Asked
Active
Viewed 464 times
2 Answers
2
There is really no connections between the GEF and the way of persistance of it's domain model.
Here is two possible solutions: 1. If you domain model are plain java objects (POJOs) try using JAXB, and annotate them with JAXB annotations.Then use JAXB to persist them. 2. Switch to using EMF (which will provide you XML serrialization out of the box) and probably to GMF.
For just Shapes Example - there is a EMF - driven Shapes Example which will serrialize model to XMI, but that can be easily changed to XML.

execc
- 1,083
- 12
- 25
1
In GMF you get automatic XML serialization since GMF is build on top EMF and GMF, using EMF as the model and GEF as the MVC framework. Editors that use GEF only must take care of serialization however they like.

vainolo
- 6,907
- 4
- 24
- 47
-
Thanks,If i use EMF Ecore model,Is it possible that i can change components in Palette after i have developed GEF Editor.Do i need to create Ecore model again? – Eshika May 24 '12 at 06:11
-
This should not be a problem. Palette tools use factories so you would have to change them – vainolo May 24 '12 at 07:01
-
Ok..But with Ecore model generated XML does not have any ID.Is it possible that we can provide ID to every ecore model component,so that we can do some operation based on this & it would be visible in XML also. – Eshika May 24 '12 at 07:31
-
Ante ecore attribute can be set as an object's Id and then it will appear in the XML – vainolo May 24 '12 at 16:33