[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt] Re: [Epsilon] top-level container in EOL

Hi Kimon,

There is no such built-in operation. However, the following operation should do the job:

operation Any topEContainer() {
  if (self.eContainer().isDefined()) {
    return self.eContainer().topEContainer();
  }
  else {
    return self;
  }
}

Cheers,
Dimitris

Kimon Polychroniadis wrote:
Hello,

I was wondering whether there is a built-in operation to find the top-lever container of a model element.

E.g.

A contains B contains C contains D

is there a method that allows me to find the top-level container, which in that case would be container A?

Thank you in advance,
Kimon