Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Can a proxy be restored after it is resolved?
Can a proxy be restored after it is resolved? [message #658268] Mon, 07 March 2011 16:20 Go to next message
Pete Ellis is currently offline Pete EllisFriend
Messages: 85
Registered: July 2009
Member
Hello everyone,

Is there a technique available through the existing EMF API that would allow
me to convert a referenced object back to its proxy state as it existed
prior to resolution? I could obviously re-load the model... but I'm trying
to incrementally restore proxy conditions (as if to "undo" the proxy
resolutions) dynamically

Thanks for any thoughts on this,

-Pete
Re: Can a proxy be restored after it is resolved? [message #658272 is a reply to message #658268] Mon, 07 March 2011 16:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30553
Registered: July 2009
Senior Member
Pete,

Comments below.

Pete Ellis wrote:
> Hello everyone,
>
> Is there a technique available through the existing EMF API that would allow
> me to convert a referenced object back to its proxy state as it existed
> prior to resolution? I could obviously re-load the model... but I'm trying
> to incrementally restore proxy conditions (as if to "undo" the proxy
> resolutions) dynamically
>
Given some EObject x that's a resolved proxy held by feature f of object
y, you can use EcoreUtil.create(x.eClass()), cast it to InternalEObject,
call setEProxyURI with EcoreUtil.getURI(x), and then use
EcoreUtil.replace(y, f, x, <that proxy object>).
> Thanks for any thoughts on this,
>
> -Pete
>
>
>
>
Re: Can a proxy be restored after it is resolved? [message #658276 is a reply to message #658272] Mon, 07 March 2011 16:41 Go to previous message
Pete Ellis is currently offline Pete EllisFriend
Messages: 85
Registered: July 2009
Member
Excellent! Many thanks, Ed, -Pete

> Pete,
>
> Comments below.
>
> Pete Ellis wrote:
>> Hello everyone,
>>
>> Is there a technique available through the existing EMF API that would
>> allow me to convert a referenced object back to its proxy state as it
>> existed prior to resolution? I could obviously re-load the model... but
>> I'm trying to incrementally restore proxy conditions (as if to "undo" the
>> proxy resolutions) dynamically
>>
> Given some EObject x that's a resolved proxy held by feature f of object
> y, you can use EcoreUtil.create(x.eClass()), cast it to InternalEObject,
> call setEProxyURI with EcoreUtil.getURI(x), and then use
> EcoreUtil.replace(y, f, x, <that proxy object>).
>> Thanks for any thoughts on this,
>>
>> -Pete
>>
>>
>>
>>
Previous Topic:EMF model file
Next Topic:Table properties
Goto Forum:
  


Current Time: Mon Oct 21 15:24:03 GMT 2019

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

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

Back to the top