|
Re: Getting the Referenced model objects from an EReference [message #427298 is a reply to message #427297] |
Wed, 11 February 2009 13:15 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------010607040100050006010904
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Christophe,
Comments below.
Christophe Bouhier wrote:
> Hi,
>
> I implement an Observer which is notified of changes to my model "Car".
> Car has a containment reference to the "Wheel" model object.
>
> When adding a Wheel to the Car, I get a notification and calling
> getFeature() on the Notifier, returns the EReference object. How do
> I get the actual Wheel object?
Using this:
/**
* Returns the value of the notifier's feature after the change
occurred.
* For a list-based feature, this represents a value, or a list of
values, added to the list.
* @return the new value of the notifier's feature.
*/
Object getNewValue();
It will be useful to look at how EContentAdapter processes notifications
since that covers all the cases.
>
>
> Thanks! Christophe
--------------010607040100050006010904
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Christophe,<br>
<br>
Comments below.<br>
<br>
<br>
Christophe Bouhier wrote:
<blockquote cite="mid:gmuipl$n0m$1@build.eclipse.org" type="cite">Hi,
<br>
<br>
I implement an Observer which is notified of changes to my model "Car".
<br>
Car has a containment reference to the "Wheel" model object.
<br>
<br>
When adding a Wheel to the Car, I get a notification and calling
<br>
getFeature() on the Notifier, returns the EReference object. How do
<br>
I get the actual Wheel object?
<br>
</blockquote>
Using this:<br>
<blockquote> /**<br>
* Returns the value of the notifier's feature after the change
occurred.<br>
* For a list-based feature, this represents a value, or a list of
values, added to the list.<br>
* @return the new value of the notifier's feature.<br>
*/<br>
Object getNewValue();<br>
</blockquote>
It will be useful to look at how EContentAdapter processes
notifications since that covers all the cases.<br>
<blockquote cite="mid:gmuipl$n0m$1@build.eclipse.org" type="cite"><br>
<br>
Thanks! Christophe
<br>
</blockquote>
</body>
</html>
--------------010607040100050006010904--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03437 seconds