|
Re: Saving in XML [message #198875 is a reply to message #198858] |
Fri, 25 July 2008 02:31 |
Eclipse User |
|
|
|
Originally posted by: lifesting.gmail.com
Raphael wrote:
> Hello everybody!
>
> I have two nodes in diagram and one link.
>
> When I draw these two nodes and link them, my XML tree remains like:
>
> <node name="a">
> <link name="link"/>
> </node>
> <node name="b"/>
>
> I would like to save the link in node b too. Like:
>
>
> <node name="a">
> <link name="link"/>
> </node>
> <node name="b">
> <link name="link"/>
> </node>
>
> Is there some way to do this?!
>
> Thanks,
> Raphael
>
hi, just define a custom ResourceFactoryImpl which extends
ResourceFactoryImpl and overrite its createResource method, then
register it by extension point org.eclipse.emf.ecore.extension_parser.
The overrited method createResource must return a resource you must
define. Assume that the new defined resource is named FooResource,
overrite its key methods: doSave and doLoad, they are used to
*serialize* all EMF ojects in GMF editor into the custom XML file you
like and parse the custom XML to prepare EMF objects GMF editor need for
initialization respectively.
that's all, in addition, class XmlString is useful when do persistence.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02992 seconds