GMF Serialization [message #168607] |
Thu, 17 January 2008 10:10  |
Eclipse User |
|
|
|
Originally posted by: gomez.rhrk.uni-kl.de
Hello,
I am relative new with GMF development. Within our application it is
required to have more than one file format (not only XML). I know from
previous threads that it is possible to extend the class ResourceImpl in
order to implement a specific format, as is the case here:
https://bugs.eclipse.org/bugs/attachment.cgi?id=80321
What I do not know, is how to use such an implementation within the GMF
code. Is there a place in the generated code where I can define customized
resources that I will use in order to save and load my files? Do I have to
define these resource classes by using extension points?
If anyone of you knows about this, I will appreciate your help.
Thanks a lot!
|
|
|
|
|
|
Re: GMF Serialization [message #171817 is a reply to message #171683] |
Thu, 07 February 2008 12:02   |
Eclipse User |
|
|
|
Originally posted by: gomez.rhrk.uni-kl.de
Hello Alex,
The problem is exactly the following:
1. I generate a GMF application but I would like to save the models herein
by using a different file format. Not XML.
2. I added the "org.eclipse.emf.ecore.extension_parser" to my EMF project,
and then my custom resource implementation class in there. I have also
specified a file type.
3. I have set up some breakpoints at my custom resource implementation
class, in the procedure doSave().
3. Then I generated the codes, for the diagram and the editors, and launch
it.
4. Afterwards, I have created a model in the editor and then try to save
it. My class is never called, and the files are still saved by using the
XML format.
I do not know if I have to set the extension point in the generated code,
or if I have to create a ResourceImplementationFactory specific for my
model, and then add this class to the extension point (By the way I have
already try this and it does not work as well).
I would appreciate if you have any further hints, because I am kind of
stuck here!!!
Thanks a lot,
Carolina.
|
|
|
Re: GMF Serialization [message #171858 is a reply to message #171817] |
Fri, 08 February 2008 05:40  |
Eclipse User |
|
|
|
Hello Carolina,
> 2. I added the "org.eclipse.emf.ecore.extension_parser" to my EMF
> project, and then my custom resource implementation class in there. I
> have also specified a file type.
How did you register your custom resource implementation in this extension
point? It should be done via custom ResourceFactory implementation (see examples
in org.eclipse.emf.ecore.xmi/plugin.xml)
> 3. I have set up some breakpoints at my custom resource implementation
> class, in the procedure doSave().
Try setting break-point in CustomResrouceImpl constructor or even in corresponding
ResourceFactoty instantiating it.
> I do not know if I have to set the extension point in the generated
> code, or if I have to create a ResourceImplementationFactory specific
Generated code is using standard EMF way to load/save resources, so you should
plug into EMF custom resource implementation and then all the EMF-based applications
will start working with it (including GMF-generated diagram editor).
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.03220 seconds