|
|
|
|
Re: A helper with a "Type element" parameter [message #631380 is a reply to message #631369] |
Thu, 07 October 2010 07:04  |
Eclipse User |
|
|
|
Thanks Sylvain!!!
I have coded the eAllContents indicating the type of the elements you want to retrieve. Perhaps it's usefull for anybody, so I Copy&Paste the ATL code here.
helper def: contentList : Sequence(metamodel!ReturnedElementType) = Sequence {};
helper context metamodel!ElementType def : contentsOfType(type : String) : Sequence (metamodel!ReturnedElementType) =
if self.eContents().notEmpty() then
thisModule.contentList->
union(self.eContents()->select(e | e.eClass().getName() = type))->
union(self.eContents()->iterate(e; seq : Sequence (sketcher!SketcherElement) = Sequence {} |
seq.union(e.contentsOfType(type))))
else
thisModule.contentList
endif;
The call is something like that:
element.contentsOfType('metamodel!ReturnedElementType')
|
|
|
Powered by
FUDForum. Page generated in 0.03900 seconds