Question on sortedBy [message #1711063] |
Mon, 12 October 2015 15:44  |
Eclipse User |
|
|
|
Hi,
I would have a question on how to force a specific sorting order.
I have a set of for loops on packages:
[for (p:Package | self.ownedElement->filter(Package)->sortedBy(name))]<drop/>
A.1 [p.name/]
[p.displayInfo()/]<drop/>
[for (p2 :Package| p.ownedElement->filter(Package)->sortedBy(name))]<drop/>
A.1.1 [p2.name/]
[p2.displayInfo()/]<drop/>
[/for]
[/for]
This code sorts my pacjkage in alphabetical order, but for the end packages, the sub-packages are named Classes, Datatypes, Diagrams, but I would have to have them in the order Diagrams first, then Classes, then Datatypes.
I have tried prefixing the name with a number, but having a title like
A.1.1.1 1-Diagrams
is not very nice.
Any other way to do custim sorting?
Best regards,
Marc
|
|
|
Re: Question on sortedBy [message #1712950 is a reply to message #1711063] |
Thu, 29 October 2015 14:21   |
Eclipse User |
|
|
|
if you don't found
you can try:
Sequence {p.ownedElement->filter(Package)->select(name = 'Diagrams'), p.ownedElement->filter(Package)->select(name = 'Classes'), p.ownedElement->filter(Package)->select(name = 'Datatypes')}->flatten()
[Updated on: Thu, 29 October 2015 14:48] by Moderator Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03012 seconds