I am using the Eclipse Nebula GridTreeViewer
which lets me access the selected items via a TreeSelection
.
This works all good except for the sort order of the elements which are returned via StructuredSelection#iterator()
. The sort order considers the order in which the elements were actually selected (e.g. when pressing Ctrl button for multi selection).
What I would need is the top=>down order of the elements as they are shown on the GUI.
I tried sorting the selection and then re-selecting with the new order. But unfortunately, the selection seems to be only updated if the actually selected elements change.
Does anyone know any other way to do this?