[Acceleo 3] write all the imports of a class [message #554861] |
Tue, 24 August 2010 10:49  |
Eclipse User |
|
|
|
Hi,
I wanna write all the imports of a class, so I want to get all the classes included in the parameters of the operations.
I tried this:
[query public getParametersOperations(class : Class) : Sequence(T) =
class.getAllOperations().parameterableElements()->select(not oclIsKindOf(Class))/]
[template public importBlock(class : Class)]
// [protected ('for imports')]
[for (at : Parameter | class.getParametersOperations())]
import [packageDomain(class) + at.type.name /];
[/for]
// [/protected]
[/template]
but If the same class is in more than one parameter, I've got a repeated import.
I want to use this in more than one place...
How can I filter the correct classes? Or you know another way to do that?
THANK YOU!!
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.31360 seconds