Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » Question on sortedBy
Question on sortedBy [message #1711063] Mon, 12 October 2015 15:44 Go to next message
Marc FLAUW is currently offline Marc FLAUWFriend
Messages: 151
Registered: July 2009
Senior Member
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 Go to previous messageGo to next message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
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]

Report message to a moderator

Re: Question on sortedBy [message #1712956 is a reply to message #1712950] Thu, 29 October 2015 14:46 Go to previous message
Marc FLAUW is currently offline Marc FLAUWFriend
Messages: 151
Registered: July 2009
Senior Member
Thanks, Tristan
Previous Topic:Maven/Tycho plugin
Next Topic:Installation cannot be completed.
Goto Forum:
  


Current Time: Wed Dec 04 06:45:29 GMT 2024

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

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

Back to the top