Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EStructuralFeature Resolution of a contained EObject Instance(How to return the EStructuralFeature used to contain a particular object instance.)
EStructuralFeature Resolution of a contained EObject Instance [message #1699368] Tue, 23 June 2015 17:50 Go to next message
Regent LArcheveque is currently offline Regent LArchevequeFriend
Messages: 94
Registered: May 2010
Member
Hi,

I'll use this simple example to present my question. A parent (EObject) contains a series of children (These children could be of different type).
e.g.
Parent
...Child 1
...Child 2
...Child 3
...

I would like to know how do I get the EStructuralFeature used to store Children X for the container Parent. I would like to have a method that implements something like:

EStructuralFeature getEStructuralFeature(EObject parentInstance, EObject childInstance)

Thanks in advance for your help.

Regent Wink
Re: EStructuralFeature Resolution of a contained EObject Instance [message #1699373 is a reply to message #1699368] Tue, 23 June 2015 19:38 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 107
Registered: April 2014
Location: USA
Senior Member
childInstance.eContainingFeature()
Re: EStructuralFeature Resolution of a contained EObject Instance [message #1699385 is a reply to message #1699373] Tue, 23 June 2015 21:39 Go to previous message
Regent LArcheveque is currently offline Regent LArchevequeFriend
Messages: 94
Registered: May 2010
Member
Thank you. Too simple!!!
Previous Topic:[CDO] "Synchronizable repositories don't support dynamic addition of new packages"
Next Topic:EMF DataBinding Transaction RollbackException
Goto Forum:
  


Current Time: Thu Apr 25 09:49:45 GMT 2024

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

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

Back to the top