Javadoc
This method is a complete hack, but is necessary to achieve the
desired behaviour when adding collapse/expand capabilities to a
treetable.
The problem is that when a mouse button is pressed, the MouseListener
installed by the UI Delegate is executed first and
changes the selected row to the row that was just clicked. This is
undesirable from the standpoint of treetables. One should be able to
expand or collapse tree nodes without adjusting the selection.
To solve the problem, we rip out the MouseListener installed by
the BasicTableUI and decorate it before reinstalling it. The decorated
version of the MouseListener detects mouse clicks that actually toggle
the collapsed/expanded state and ensures that we do not change the
selected row in that case.