Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 97436

Summary: Problems in the EMF editor "save"
Product: [Modeling] EMF Reporter: Alexandre Torres <alexandre.torres>
Component: EditAssignee: Marcelo Paternostro <marcelop>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Alexandre Torres CLA 2005-05-31 08:01:38 EDT
I noticied that the EMF editor generated from the metamodel shows all related
resources in the "selection" tab or in the outline view. It show the properties
in the property view too and let the user change the data.
Suppose I have 2 files F1 and F2. F1 contais Object A, F2 Object B,C and D.
If A references B and D, when I select A on F1 it opens F2.
But after saving the data closing the file and opening again, I saw that it
saved only the data not referenced.
I changed the method doSave of the Editor generated class to save all the resources:
for (Iterator
it=editingDomain.getResourceSet().getResources().iterator();it.hasNext();) {
             Resource savedResource = (Resource)it.next();
             savedResources.add(savedResource);
             savedResource.save(Collections.EMPTY_MAP);    
}
At start it worked, but there is a situation that it doesn't. If instead of
opening the A object on file 1, I go to the Load resources menu and open the
file 2,and them I change the order of D and C by drag and drop, the Object A
will start referencing Object C instead of D (before and after save). Does It
happens becouse on XMI it uses positional reference? 
The strange thing is that if Object A is opened before I change the order, it
works fine (some kind of listner may warn Oject a?). The problem also happens
when the resource F2 is automatically opened by other file.
Comment 1 Dave Steinberg CLA 2006-01-24 12:13:28 EST
This has been fixed as part of bug 118688: now generated editors will save all resources in the resource set in their doSave().

*** This bug has been marked as a duplicate of 118688 ***