I'd like the user to be able to sort the
This isn't really automatic.
You need to call
TreeColumn.addSelectionListener to add a selection listener to deal with the clicks on the tree column headers.
You will then need to get the
Tree from the
Tree tree = viewer.getTree();
and then call
to set the indicated main sort column and
tree.setSortDirection(SWT.UP) // or SWT.DOWN
to set the indicated sort direction.
to make the viewer redo the sorting.
You will need to track the column(s) to sort on in your comparator.