[REVIEW REQUEST] Improvements to TableView sorting

Jonathan Giles jonathan.giles at oracle.com
Mon Feb 18 13:54:14 PST 2013


>>> And in B), will sorting happens as it currently does, i.e. by mutating
>>> the user's list, or will TableView have an internal SortedList (as
>>> discussed previously)?
>>
>> Mutation will happen on the users list as currently occurs - there will
>> be no internal SortedList.
>
> How will it then be returned to an unsorted state?
It won't - when an ObservableList is used we will maintain the current 
behavior of not retaining the original, unsorted state. For people who 
want to support returning to an unsorted state but otherwise have 
functionality like that of a normal ObservableList, they will do 
something like this:

SortedList sortedList = new SortedList(SortedList.UNSORTED); // where 
SortedList.UNSORTED is a special Comparator
sortedList.setAll(....);
TableView tableview = new TableView(sortedList);
sortedList.comparatorProperty().bind(tableview.comparatorProperty());
>
> And, as I'm not sure if a conclusion was reached in the previous 
> thread about FilteredList/SortedList, what happens here if the 
> provided list is a FilteredList or some other TransformedList (but not 
> a SortedList) - was the decision to make TransformedList mutable after 
> all?
I've not been closely involved in these discussions, so I'll leave that 
to Richard and / or Martin to answer.

-- Jonathan



More information about the openjfx-dev mailing list