Skip to main content



      Home
Home » Eclipse Projects » Sirius » Eclipse Sirius: How to access ancestors of the EObject of a line mapping?(I am try to create a column for name of an ancestor of the line mapping object. What field in the line/featureColumn mapping must be used for this? How would the expression look? )
Eclipse Sirius: How to access ancestors of the EObject of a line mapping? [message #1695259] Wed, 13 May 2015 02:21 Go to next message
Eclipse UserFriend
I have tried giving this value to the LabelExpression of the column"[lineSemantic.oclAsType(<myClassForTheLineMapping>).ancestors().eContainer(<AncestorClassName>)/]. This doesn't seem to work.

I have tried giving "[thisEObject.ancestors()/]" value to the Associated Elements expression. But I don't know how to make us of it to display the value in the column.

Re: Eclipse Sirius: How to access ancestors of the EObject of a line mapping? [message #1695974 is a reply to message #1695259] Wed, 20 May 2015 12:46 Go to previous message
Eclipse UserFriend
Le 13/05/2015 15:23, Vijetha Shivarudraiah a écrit :
> I have tried giving this value to the LabelExpression of the
> column"[lineSemantic.oclAsType(<myClassForTheLineMapping>).ancestors().eContainer(<AncestorClassName>)/].
> This doesn't seem to work.
>
> I have tried giving "[thisEObject.ancestors()/]" value to the Associated
> Elements expression. But I don't know how to make us of it to display
> the value in the column.
>
>
Hi
Could you precise what you expect as a result please.

> column"[lineSemantic.oclAsType(<myClassForTheLineMapping>).ancestors()
As ancestors is not a method specific to <myClassForTheLineMapping> you
can do without oclAsType

Based of what I guessed :
> ... .ancestors().eContainer(<AncestorClassName>)
If you want the first ancestor of type <AncestorClassName> just use
eContainer(<AncestorClassName>)
Or if you want all ancestors of type <AncestorClassName> use
ancestors(<AncestorClassName>)

So it would become [lineSemantic.eContainer(<AncestorClassName>)/] or
[lineSemantic.ancestors(<AncestorClassName>)/]
Previous Topic:Filter elements according to an attribute
Next Topic:Display Semantic properties on the Label
Goto Forum:
  


Current Time: Thu May 22 19:44:29 EDT 2025

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

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

Back to the top