|
|
|
Re: What is InverseMaintenaceAdapter for? [message #610909 is a reply to message #108638] |
Mon, 03 October 2005 10:45  |
Eclipse User |
|
|
|
Hi John,
> can somebody explain me what is InverseMaintenaceAdapter for?
EMf provides an XMI based object model that the VE uses to store a model
of the Java GUI, its beans and their properties and relationships. In
EMF you can walk from an object across a feature using code like
EStructuralFeature sourceFeature = source.eClass().eGetFeature(featureName);
source.eGet(sourceFeature);
For example, if you want to go from an IJavaInstance has has a "control"
feature you do
EStructuralFeature sf = javaInstance.eClass().eGetFeature("control");
IJavaInstance controlInstance = javaInstance.eGet(sf);
Now if you have the control and want to see who references it through
control feature you are walking backwards. The first thing to do is get
the structural feature that you think points to you doing something like
EStructuralFeature sf =
Utilities.getJavaClass("com.package.ClassThatPointsToMe",resourceSet).eGet( "control");
InverseMaintenceAdapter.getfirstReferencedBy(controlInstance ,sf);
Each time an EMF object points to another a back pointer is added
automatically by the VE that can be found using
InverseMaintenacenAdapter, which is very useful for doing things like
cascading delete or just working out how an object is used.
Best regards,
Joe Winchester
|
|
|
|
Powered by
FUDForum. Page generated in 0.03841 seconds