Using EMF with multiple editors [message #245349] |
Fri, 05 September 2008 07:49  |
Eclipse User |
|
|
|
Originally posted by: andreas-scharf.gmx.de
Hi,
I'm not sure weather it's the right place to post this question. If not
just redirect me :).
I created a model with EMF and wrote an editor with GEF. Let's say I
have two modeled objects:
A: Can contain B's and is saved in it's own file
B: Is contained in A but can have references to other A's.
This leads two some problems because I could have opened two different
A's, let's say A1 and A2 in different editors where A2 is referenced
from a B which is contained in A1. So changes made in A1 (which is
opened in editor1) can also affect A2 (which is opened in editor2). To
"solve" that problem of synchronization I share my ModelManager (which
is a singleton and responsible for loading files and turning them into
EMF Resources) across several editors. That seems to work but I wonder
if I can run into problems which I haven't seen yet.
How do solve the problem of editing parts of one object in different
editors/view within the eclipse framework?
Thx,
Andreas
|
|
|
|
Re: Using EMF with multiple editors [message #245364 is a reply to message #245349] |
Fri, 05 September 2008 18:51  |
Eclipse User |
|
|
|
Originally posted by: omoises.nospam-nordnet.fr
Andreas,
Did you build your editor as explained in the article :
http://www.eclipse.org/articles/Article-GEF-EMF/gef-emf.html ?
In this case, since you EditPart's model is an (in memory) EObject, you
are able to use 2 or more editors on the same resource.
Any change in the underlying EMF model will be reflected in GEF since
EditPart activate() adds EMF Adapters to your EObjects.
How do you load your EMF model ? Do you use Resource/ResourceSet
standard mechanism (which respects proxies resolution) ?
Regards,
Olivier
Andreas Scharf a écrit :
> Hi,
>
> I'm not sure weather it's the right place to post this question. If not
> just redirect me :).
>
> I created a model with EMF and wrote an editor with GEF. Let's say I
> have two modeled objects:
>
> A: Can contain B's and is saved in it's own file
> B: Is contained in A but can have references to other A's.
>
> This leads two some problems because I could have opened two different
> A's, let's say A1 and A2 in different editors where A2 is referenced
> from a B which is contained in A1. So changes made in A1 (which is
> opened in editor1) can also affect A2 (which is opened in editor2). To
> "solve" that problem of synchronization I share my ModelManager (which
> is a singleton and responsible for loading files and turning them into
> EMF Resources) across several editors. That seems to work but I wonder
> if I can run into problems which I haven't seen yet.
>
> How do solve the problem of editing parts of one object in different
> editors/view within the eclipse framework?
>
> Thx,
> Andreas
|
|
|
Powered by
FUDForum. Page generated in 0.03132 seconds