Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Retrieve EditingModel from EObject
Retrieve EditingModel from EObject [message #425142] Sun, 16 November 2008 20:53 Go to next message
Eclipse UserFriend
Originally posted by: nuclearpsyche.gmail.com

Hello,
Is it possible to find out which EditingDomain a certain EObject belongs
to? (for example can I get the EditingDomain by only knowing the root
object?)
Thanks,

tamer
Re: Retrieve EditingModel from EObject [message #425143 is a reply to message #425142] Mon, 17 November 2008 00:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Tamer,

If you are working with a TransactionalEditingDomain, then you can use
TransactionUtil::getEditingDomain(EObject) to find your answer.

In a non-transactional editing domain, I don't think that there is
traceability from the ResourceSet to the EditingDomain, though. You
will need to know the workbench part that you're dealing with and adapt
it to IEditingDomainProvider to get the editing domain from it.

HTH,

Christian

Tamer wrote:
> Hello,
> Is it possible to find out which EditingDomain a certain EObject belongs
> to? (for example can I get the EditingDomain by only knowing the root
> object?)
> Thanks,
>
> tamer
Re: Retrieve EditingModel from EObject [message #425169 is a reply to message #425143] Tue, 18 November 2008 06:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30900
Registered: July 2009
Senior Member
Guys,

You can use AdapterFactoryEditingDomain.getEditingDomainFor...


Christian W. Damus wrote:
> Hi, Tamer,
>
> If you are working with a TransactionalEditingDomain, then you can use
> TransactionUtil::getEditingDomain(EObject) to find your answer.
>
> In a non-transactional editing domain, I don't think that there is
> traceability from the ResourceSet to the EditingDomain, though. You
> will need to know the workbench part that you're dealing with and
> adapt it to IEditingDomainProvider to get the editing domain from it.
>
> HTH,
>
> Christian
>
> Tamer wrote:
>> Hello,
>> Is it possible to find out which EditingDomain a certain EObject
>> belongs to? (for example can I get the EditingDomain by only knowing
>> the root object?)
>> Thanks,
>>
>> tamer
Re: Retrieve EditingModel from EObject [message #425180 is a reply to message #425169] Tue, 18 November 2008 14:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Ah! The same adapter approach. Silly me; I should have looked more
closely.

cW

Ed Merks wrote:
> Guys,
>
> You can use AdapterFactoryEditingDomain.getEditingDomainFor...
>
>

-----8<-----
Re: Retrieve EditingModel from EObject [message #425217 is a reply to message #425143] Wed, 19 November 2008 22:20 Go to previous message
Eclipse UserFriend
Originally posted by: nuclearpsyche.gmail.com

Thank you very much Christian,
That's exactly what I needed.

tamer

Christian W. Damus wrote:
> Hi, Tamer,
>
> If you are working with a TransactionalEditingDomain, then you can use
> TransactionUtil::getEditingDomain(EObject) to find your answer.
>
> In a non-transactional editing domain, I don't think that there is
> traceability from the ResourceSet to the EditingDomain, though. You
> will need to know the workbench part that you're dealing with and adapt
> it to IEditingDomainProvider to get the editing domain from it.
>
> HTH,
>
> Christian
>
> Tamer wrote:
>> Hello,
>> Is it possible to find out which EditingDomain a certain EObject
>> belongs to? (for example can I get the EditingDomain by only knowing
>> the root object?)
>> Thanks,
>>
>> tamer
Previous Topic:Exchanging templates for generation from GenModel
Next Topic:HibernateResource vs XmiResourceImpl performances ?
Goto Forum:
  


Current Time: Mon Feb 24 16:15:05 GMT 2020

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