On Sun, 23 May 2021 15:03:21 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

> This was my first thought, too. However, it doesn't work because 
> `SelectedItemsReadOnlyObservableList` doesn't truthfully report its changes, 
> so we can't simply replay its reported changes onto our copy of the items 
> list. 

You mean `selectedIndices` not reporting truthfully? That's true, but no excuse 
for selectedItems to misbehave on its own :) The one and only task of 
selectedItems is to transform the notifications received from the indices into 
items' value space and that's what it must do correctly.

And yes, MultipleSelectionModelBase is a very deep and very dark pit. Some 
corners where smoothed over the years which generally improved the overall 
behaviour. The path chosen has hacky elements, though: f.i. exposing internal 
api (like the nextXX methods) as public is .. extremely suboptimal and 
introduced the smear of who-does-what without caring overly much about 
contracts. Now we have to deal with a multi-headed monster that grows new heads 
whenever one is cut .. /rant-end

-------------

PR: https://git.openjdk.java.net/jfx/pull/478

Reply via email to