[REVIEW REQUEST] Improvements to TableView sorting

Knut Arne Vedaa knut.arne.vedaa at broadpark.no
Thu Feb 21 03:25:55 PST 2013

Scott Palmer wrote:
> On 2013-02-19, at 11:03 PM, John Hendrikx<hjohn at xs4all.nl>  wrote:
>> On 19/02/2013 23:41, Knut Arne Vedaa wrote:
>>>> It's not possible to do it in a single remove event.
>>> Can't you do it in a single operation if you use List#removeAll?
>> No, if you select the top half of the items in a list sorted by Last Name, then resort the list by First Name, the selection will no longer be a single range.  If you decide to delete them at that point, you'll have to do many small deletes.
> Not with removeAll. It doesn't use a range. You give it a list containing only the nodes you wish to remove.

I think the problem is that removeAll removes by element. In a select -> 
delete scenario you can't really do that because a given element may (at 
least in theory) appear more than once in the list.

So for this to be efficient we would need an 
ObservableList#removeAllByIndex(List<Integer> indices) method.

Knut Arne

More information about the openjfx-dev mailing list