Infer EReference from a CompartmentEditParthttps://www.eclipse.org/forums/index.php/mv/msg/384956/923887/#msg_923887
i'm wondering if it is possible to infer the corresponding EReference in the semantic model from a CompartmentEditPart in the notational model.

I know how to retrieve the EObject the CompartmentEditPart refers to, but is it also possible to get the EReference that is used to store the child objects?]]>Thomas Buchmann2012-09-26T09:26:45-00:00Re: Infer EReference from a CompartmentEditParthttps://www.eclipse.org/forums/index.php/mv/msg/384956/936825/#msg_936825
I only found a way to get it via the children contained in a compartment. I exectuted the following on a notational model instance via the OCL console. This might be helpful:

self.children.element.eContainmentFeature()

Ralph]]>Ralph Gerbig2012-10-08T11:26:23-00:00Re: Infer EReference from a CompartmentEditParthttps://www.eclipse.org/forums/index.php/mv/msg/384956/939175/#msg_939175
thanks for your reply. I'm afraid this won't work with an empty Compartment.

Thomas]]>Thomas Buchmann2012-10-10T13:45:16-00:00Re: Infer EReference from a CompartmentEditParthttps://www.eclipse.org/forums/index.php/mv/msg/384956/940028/#msg_940028
I doubt it is possible to get access to the meta-information at the diagram runtime.

(Also there may be a lot of the different children types associated with same compartment, so it is more correct to tell about the List<EReference> instead of just EReference).

However, if you are using GMF-Tooling, you may add custom template to generate into every XXComartmentEditPart a new method that will provide access to this meta-, and then use it at runtime in your custom code.

Please let me know if you need more help with that way of solving the problem.