Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Using EMF with multiple editors
Using EMF with multiple editors [message #245349] Fri, 05 September 2008 11:49 Go to next message
Eclipse UserFriend
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 #245354 is a reply to message #245349] Fri, 05 September 2008 13:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lifesting.gmail.com

Andreas Scharf wrote:
> 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

Hi, you'd better post it on GMF. In GMF, the problem you described can
be solved perfectly.
Re: Using EMF with multiple editors [message #245364 is a reply to message #245349] Fri, 05 September 2008 22:51 Go to previous message
Eclipse UserFriend
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
Previous Topic:GEF Project to RCP
Next Topic:container edit part
Goto Forum:
  


Current Time: Fri Sep 20 04:10:48 GMT 2024

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

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

Back to the top