Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Edior out of synch with the file system
Edior out of synch with the file system [message #655939] Wed, 23 February 2011 12:04 Go to next message
Daniel Rippel is currently offline Daniel RippelFriend
Messages: 29
Registered: July 2009
Junior Member
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
Re: Edior out of synch with the file system [message #655956 is a reply to message #655939] Wed, 23 February 2011 14:25 Go to previous message
Daniel Rippel is currently offline Daniel RippelFriend
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
}
}
Previous Topic:Aggregation as a link
Next Topic:How to display aggregations like links in the generated editor
Goto Forum:
  


Current Time: Fri Feb 26 07:04:29 GMT 2021

Powered by FUDForum. Page generated in 0.01419 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top