Yes, exactly. I use OCL for it:
parent.elements->indexOf(self)
I somehow feel, this is not the optimal way...
Best, Philipp
Ed Merks wrote:
Philipp,
So you're doing something like this?
List<?> values =
(List<?>)eObject.eContainer().eGet(eObject.eContainmentFeature());
int index = values.indexOf(eObject);
And then incrementing or decrementing index and checking it abounds
the 0 or value.size()?
Philipp W. Kutter wrote:
Hi, Everybody.
I tried several ways to derive position, predecessor, and successor of
lists in earlier projects.
What is the best way doing this?
I remember starting with the EObject, finding its containing
feature, geting the EList like this, and then looking it through.
Is there a faster, easier way?
Best, Philipp