By default, if you have more than one SortKey in a JTable's row-sorter, every click on a column header will make that column's SortKey to be the primary one.
I need to change this behaviour so the first click on a column header makes that SortKey the primary one, a click to another column header would make that column's SortKey the secondary one, and so on.
Also, when, say maxSortKeys is reached, a click on another (not sorted) column would trigger the shuffling of sort-keys. The newly clicked column would have SortKey with lowest priority, the primary key column will lose its SortKey, and the column with secondary SortKey will become the primary one, etc.
At the moment, I implemented my own TableHeader in order to capture the event when user clicks on the column header in order to shuffle SortKeys appropriately.
To illustrate it with an example:
[ One | Two ↑1 | Three ↓2 | Four | Five ↑3 ]
[ | | | | ]
After user clicks on the first column's header:
[ One ↑3 | Two | Three ↓1 | Four | Five ↑2 ]
[ | | | | ]
What I wonder is whether you think this is a good approach or not?