EMF-Edit: visualizing the object referencing an object?

100 Views Asked by At

I created a EMF ecore model that could look like this:

  • The model contains a list of Family
  • The model contains a list of VisitedCountry
  • A Family contains a list of Individual
  • A VisitedCountry contains a list of references to some Individuals

after the plugins EMF-Edit and EMF-Editor have been generated and when I run the generated GUI: when I click an Indvidual, is there a way to display a table listing all his VisitedCountry ?

1

There are 1 best solutions below

0
On

To easily do that, you could add a non-containment reference from Individual to VisitedCountry, which must be an opposite reference (EOpposite) to the reference you defined from VisitedCountry to Individual.

Doing that, you could check when selecting an Individual when editing your model with the generated model editor, you can access their VisitedCountry in the Properties View. In general defining EOpposite references beetween classes is always useful for other puposes, since you have bidirectional navigation between both classes.