Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Where is my editing domain set to null(Integrating EMF and GMF editors)
Where is my editing domain set to null [message #1012106] Wed, 20 February 2013 17:05 Go to next message
Arto Jarvinen is currently offline Arto Jarvinen
Messages: 32
Registered: May 2010
Location: Sweden
Member
I'm working on integrating EMF and GMF editors. I'm using the same editing domain over all editors and intend to have it active throughout the lifetime of the editors. When I go between a GMF editor, the EMF editor and back to the GMF editor, the editing domain gets deallocated (set to null). I suspect that this happens when the EMF editor loses focus but I haven't been able to track down where that happens. I have modified the GMF editors so that they don't dispose the editing domain when they lose focus.

Any hints as to how I can do the same for the EMF editor (page)? Thanks! -Arto


Re: Where is my editing domain set to null [message #1012193 is a reply to message #1012106] Wed, 20 February 2013 22:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26013
Registered: July 2009
Senior Member
Arto,

A generated EMF editor doesn't dispose anything until it's closed, so it
sounds like you've done something to share editing domains between
editors, but I'm not aware of the details associated with how you've
done that.


On 20/02/2013 11:05 PM, Arto Jarvinen wrote:
> I'm working on integrating EMF and GMF editors. I'm using the same
> editing domain over all editors and intend to have it active
> throughout the lifetime of the editors. When I go between a GMF
> editor, the EMF editor and back to the GMF editor, the editing domain
> gets deallocated (set to null). I suspect that this happens when the
> EMF editor loses focus but I haven't been able to track down where
> that happens. I have modified the GMF editors so that they don't
> dispose the editing domain when they lose focus.
>
> Any hints as to how I can do the same for the EMF editor (page)?
> Thanks! -Arto
>
Re: Where is my editing domain set to null [message #1012240 is a reply to message #1012193] Thu, 21 February 2013 02:15 Go to previous messageGo to next message
Arto Jarvinen is currently offline Arto Jarvinen
Messages: 32
Registered: May 2010
Location: Sweden
Member
Thanks Ed. I thought it was somehow disposed as is done in the GMF-generated editors. In the GMF editor the ResourceSetInfo is disposed when the editor loses focus and that disposal in turn disposes the editing domain. I've edited away this piece of code in the GMF editor and so I keep my editing domain when I go between several GMF editors. The fact remains though that when I set the focus GMF -> EMF -> GMF i have lost my editing domain. In my EMF editor I do the following in initializeEditingDomain:

// Use the same editing domain as the GMF editors do.
TransactionalEditingDomain domain = TransactionalEditingDomain.Registry.INSTANCE.getEditingDomain("com.ostrogothia.processmodel.diagram.EditingDomain");


While the EMF editor is open, this works (it shows my GMF notational model also in the EMF editor) but is then somehow set to null when i click on an GMF editor tab.

I will keep on looking...

Cheers, -A


Re: Where is my editing domain set to null [message #1013428 is a reply to message #1012240] Sat, 23 February 2013 11:29 Go to previous message
Arto Jarvinen is currently offline Arto Jarvinen
Messages: 32
Registered: May 2010
Location: Sweden
Member
Ok, it's not the editing domain that is disposed, it the contents of the graphical editor that are getting unloaded and the program is trying to find the editing domain through the contents. So now I'm looking at all places where resources are unloaded instead... -A

Previous Topic:Change generated DiagramFile.gif icon automatically
Next Topic:Delete Connection of a Node Programmatically
Goto Forum:
  


Current Time: Fri Aug 29 01:45:34 EDT 2014

Powered by FUDForum. Page generated in 0.02003 seconds