Multiple diagrams [message #6676] |
Sat, 05 August 2006 20:07  |
Eclipse User |
|
|
|
Originally posted by: bob2.msn.com
Hi,
As I posted in the Load/Save Synchronisation thread of the
eclipse.technology.gmf newsgroup, I am having problems with synchronising
between diagrams.
I have 2 diagrams related be the same model. There is only ever going to be
one instance of Diagram1 but there will be many Diagram2's for 'child'
elements of Diagram1
When these two different types of diagrams are open at the same time,
whenever one of the diagrams is saved, the model is overwritten with the
information in the saved diagram and the model information in the other
diagram is lost. This has been discussed before and the suggestion was to
register the editing domain on the
org.eclipse.emf.transaction.editingDomains extension point. I have done
this to both diagram plugins. I have changed the getEditingDomainID() method
of both diagram editors to return the same value and have also removed the
createEditingDomain() methods of both editors. This causes both diagrams to
use the same ResourceSet and therefore prevent the overwriting of data which
works ok. It also makes the editors become 'dirty' and saving any of the
open editors effectively saves all the diagrams.
The problem I face is that when a diagram is not currently open, if a change
is made in any of the other open editors, all diagram information will be
deleted from this diagram file, leaving just
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
in the xml file.
How can I prevent this from happening?
Thanks a lot
Bob
|
|
|
|
|
|
|
|
Re: Multiple diagrams [message #19369 is a reply to message #19281] |
Tue, 15 August 2006 10:45  |
Eclipse User |
|
|
|
Hello Jack,
> It won't be enough in the case where multiple diagrams are open that
> share the same ResourceSet - if you modify both diagrams and save one,
I see, but it's not so easy to select correct set of resources in case of
referencing some EObjects stored in a different resources. I'd say that current
bevahior is ok as a default one and in case of some specific requirements
you can modify corresponding code manually.
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.08721 seconds