|
|
|
Re: Add EContentAdapter [message #538771 is a reply to message #538654] |
Tue, 08 June 2010 15:09 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Ayia,
Such a content adapter can definitely get notifications for all objects
in the entire resource set so you could definitely find out about all
changes that happen to all B instances. I'm not sure if given a B, you
immediately know which A instance(s) refer to it, i.e., if it has an
opposite, or is a containment reference and hence EObject.eContainer is
an implicit opposite. You might want to use an ECrossReferenceAdapter
which actually helps to track inverses references for references that
don't have opposites..
wg@mci.sdu.dk wrote:
> Thank you Ed, your reply enlightened me.
>
> I stuck with this problem in a scenario like: If I have created a
> model containing A and B instances, In one A instance I have set the
> reference to certain B instance (during set I was able to add
> adapter), and then closed the editor with a serialized model, next
> time when I open the editor with the model again, I would like A
> directly response to possible changes of the referenced B (which I
> failed to achieve).
>
> I think what I should do is adding an EContentaAdapter in the
> createModel() method inside the generated editor plugin, so that
> interested modifications will be notified. Is this approach correct or
> some better solutions are available.
>
> Thank you very much for your reply!
> Ayia
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03558 seconds