Add expand/ collapse links to a tree widget.

#5875