[REVIEW REQUEST] Improvements to TableView sorting

Jonathan Giles jonathan.giles at oracle.com
Tue Feb 19 14:30:31 PST 2013

>> And the reason for this is that the SortedList is unmodifiable (but 
>> mutable). So the add / remove methods etc throw unsupported operation 
>> exception, so from the table's perspective, it cannot be sorted. So 
>> if you use such a list, then you have to take one more step to wire 
>> up the comparator of the sorted list to the comparator on the table 
>> view, so that whenever the comparator changes the sorted list is 
>> notified of it and can do its own sorting internally.
> What happens if you use an unmodifiable ObservableList that is not a 
> SortedList? Is there a way to _explicitly_ say to TableView "don't 
> sort me"?
If the list is unmodifiable then it will not be sorted by TableView. 
SortedList is not sorted by TableView because it is unmodifiable, not 
because it is a SortedList.

-- Jonathan

More information about the openjfx-dev mailing list