Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsKeeping package hierarchy in the documentation
https://www.eclipse.org/forums/index.php/mv/msg/1087126/1766910/#msg_1766910
I'm able to sort the packages by name, with the following command:
[for(p:Package|self.ownedElement->filter(Package)->sortedBy(name))]
It seems that without the sortedBy, the packages are not ordered like in the project hierarchy, is there a way to do this (ie specifying an id attached to the package, or a specific diagram) ?
Samuel]]>samuel kallmeyer2017-06-28T16:52:10-00:00Re: Keeping package hierarchy in the documentation
https://www.eclipse.org/forums/index.php/mv/msg/1087126/1766953/#msg_1766953
Yves BERNARD2017-06-29T06:03:40-00:00Re: Keeping package hierarchy in the documentation
https://www.eclipse.org/forums/index.php/mv/msg/1087126/1766966/#msg_1766966
I'm ok with your definition of hierarchy: by considering multiple elements at the same level (ie: Root element with packages) as in the attached picture, I would like to keep the ordering as in the "project"...
]]>samuel kallmeyer2017-06-29T07:42:41-00:00Re: Keeping package hierarchy in the documentation
https://www.eclipse.org/forums/index.php/mv/msg/1087126/1766970/#msg_1766970
I don't remember if a query exists in the standard gendoc API (but it should ;))
But you can try something like that :
[for(p:Package|self.ownedElement->filter(Package)->sortedBy( e | e.eContainer().eContents()->indexOf(e))/]
The sortedBy expression will use the value returned by index of to sort the elements
(Simpler) You can also do : [for(p:Package|self.eContents()->filter(Package))/]]]>Tristan Faure2017-06-29T08:01:46-00:00Re: Keeping package hierarchy in the documentation
https://www.eclipse.org/forums/index.php/mv/msg/1087126/1766980/#msg_1766980
I used the simpler solution and works fine.