How to save both model and diagram in the same file from "File - Save as" menu [message #482593] |
Thu, 27 August 2009 04:17  |
Eclipse User |
|
|
|
Hi all,
In our gmfgen, we've set the "Same file for diagram and model" to 'true'.
It works fine but when editing a diagram, then using the "File > Save As"
menu, it saves only the diagram part in the file. The model is referred
from it but I would like that both diagram and model are saved in the same
file.
Does anyone know how to do it ? Is there any method to override ?
Regards,
Jerome
|
|
|
|
|
|
|
|
Re: How to save both model and diagram in the same file from "File - Save as" menu [message #552662 is a reply to message #482613] |
Fri, 13 August 2010 01:39  |
Eclipse User |
|
|
|
Originally posted by: leomaggie365.163.com
On 2009-8-27 17:43, Alex Shatalin wrote:
> Hello Jerome,
>
> You need to modify ???DocumentProvider.doSaveDocument() [if (info ==
> null) branch].
>
> -----------------
> Alex Shatalin
>
>
Hi Jerome and Alex,
Just redirct your own domain model's root model to any Resource's
contents, then save that resource.
If a diagram refers to your domain root model myModelRoot, resource is
the target file you need to save you model(may be as the same as your
diagram file).
As your discussed, in DocumentProvider.doSaveDocument(), get myModelRoot
from diagram, and resource.getContents().add(myModelRoot),
resource.save(null).
That all, try it.
|
|
|
Powered by
FUDForum. Page generated in 0.11311 seconds