RFR: 8237602: TabPane doesn't respect order of TabPane.getTabs() list

Kevin Rushforth kcr at openjdk.java.net
Wed Apr 29 14:44:48 UTC 2020


On Wed, 29 Apr 2020 09:58:21 GMT, Jeanette Winzenburg <fastegal at openjdk.org> wrote:

>> Issue:
>> When tabs are permuted as mentioned in the issue description as,
>> 1. TabPane.getTabs().setAll(tab0, tab1)
>> 2. TabPane.getTabs().setAll(tab0, tab1, tab2, tab3);
>> the tab headers do not get permuted in same order as `TabPane.getTabs()`.
>> 
>> => tab headers should be shown in order as  tab2, tab3, tab0, tab1.
>> => But should are show in order as  tab0, tab1, tab2, tab3
>> 
>> Cause:
>> Newly added tabs(tab2, tab3) are not inserted at correct index. The index `Change.getFrom()` (0) used from Change does
>> not remain valid after the tabs to be moved(tab0, tab1) are removed from `tabsToAdd` list.
>> Fix:
>> Use the index of first newly added tab, from `TabPane.getTabs()`, which would be always reliable.
>> 
>> Verification:
>> No existing tests fail due to this change.
>> Added a system test which fails without and pass with fix.
>
> didn't look closely, just wondering why you need a system test for this?

The following is wrong in your Description:

> => tab headers should be shown in order as tab2, tab3, tab0, tab1.
> => But should are show in order as tab0, tab1, tab2, tab3

Based on what I see in the bug report (and what I would expect), I'm pretty sure you meant to say:

The tab headers should be shown in order as tab0, tab1, tab2, tab3.
But are shown in order as tab2, tab3, tab0, tab1.

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

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


More information about the openjfx-dev mailing list