Retrieve EditingModel from EObject [message #425142] |
Sun, 16 November 2008 20:53 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Ed Merks Messages: 33140 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
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Retrieve EditingModel from EObject [message #425180 is a reply to message #425169] |
Tue, 18 November 2008 14:20 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03851 seconds