Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Infer EReference from a CompartmentEditPart
Infer EReference from a CompartmentEditPart [message #923887] Wed, 26 September 2012 09:26 Go to next message
Thomas Buchmann is currently offline Thomas Buchmann
Messages: 53
Registered: November 2010
Member
Hi all,

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?
Re: Infer EReference from a CompartmentEditPart [message #936825 is a reply to message #923887] Mon, 08 October 2012 11:26 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

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
Re: Infer EReference from a CompartmentEditPart [message #939175 is a reply to message #936825] Wed, 10 October 2012 13:45 Go to previous messageGo to next message
Thomas Buchmann is currently offline Thomas Buchmann
Messages: 53
Registered: November 2010
Member
Hi Ralph,

thanks for your reply. I'm afraid this won't work with an empty Compartment.

Thomas
Re: Infer EReference from a CompartmentEditPart [message #940028 is a reply to message #939175] Thu, 11 October 2012 08:45 Go to previous message
Michael Golubev is currently offline Michael Golubev
Messages: 373
Registered: July 2009
Senior Member
Thomas,

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.

Regards,
Michael
Previous Topic:OpenDiagramEditPolicy
Next Topic:Generate figures on canvas automaticlly
Goto Forum:
  


Current Time: Thu Oct 23 14:30:27 GMT 2014

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

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