|
Re: Edior out of synch with the file system [message #655956 is a reply to message #655939] |
Wed, 23 February 2011 14:25 |
Daniel Rippel Messages: 29 Registered: July 2009 |
Junior Member |
|
|
Daniel Rippel schrieb:
> Hi to all,
>
> I have a problem using GMF editors on different referencing model files.
>
> 1) Setting:
> I have two models, Model 1 contains elements of Typ A and Model 2
> contains elements of Type B. Both models are stored in their own files.
> Type A holds an "opposite reference" to Type B.
>
> Type A
> - typeBs [0..*] (opposite TypeB.typeAs)
>
> Type B
> - typeAs [0..*] (opposite TypeA.typeBs)
>
> 2) Problem
>
> On Editor open, I pass the other model's resource to be included in the
> opend model's resource set. This allows me to edit the list using the
> default property sheet.
> The problem occurs if I save the modified diagram. Both resources get
> saved (due to the opposite relationship), but afterwards, the GMF editor
> tells me that it is out of sync with the file resource. The only thing I
> could imagine, is that when saving model A, B gets saved too and resaves
> A again.
>
> Anyone has a suggestion how to avoid this or how to refresh the editor
> window again?
>
> Thank you in advance
> Daniel
Ok, I think I figured something out. For me it worked to override the
editords doSave() Methode and to trigger an update of the Workspace:
/**
* @generated NOT
*/
@Override
public void doSave(IProgressMonitor progressMonitor) {
super.doSave(progressMonitor);
try {
ResourcesPlugin.getWorkspace().getRoot().refreshLocal(projec tDepth,
progressMonitor);
} catch (CoreException e) {
; // Do some logging
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.03419 seconds