The use case is as follows:
-I have a debugger local variables view and I want to implement "find"/"find
next"/"find previous" actions for searching for some variable name/value
-In order to do this I need the following:
a)A way to iterate over all nodes in the variables view in the order in which
they are currently sorted. This is so that find next/previous find in the order
they are currently sorted in the tree.
b)A way to select the Node which is found.
Additional use cases can be envisioned outside the scope of the debugger. The
viewmodel package is a nice general-purpose tree table component and so it
would be very nice to have control over selection and iteration.
I have an implementation which does this with the current APIs, but it's a bit
of a hack and also doesn't handle all cases. Basically what I am doing is
digging out the ExplorerManager from the TreeTable component and I am doing my
own sorting based on the current state of the column model. This works
reasonable well, but in certain edge cases, the sort order I compute is not the
same as that used by the treetable. (Namely, for elements which compare equal,
they preserve the previous sort order in the tree, rather than the unsorted
order in the node's children array.)