RFR: 8300893: Wrong state after deselecting two or more cells of a TableView selection
Ajit Ghaisas
aghaisas at openjdk.org
Tue Feb 14 11:52:51 UTC 2023
On Mon, 23 Jan 2023 20:40:23 GMT, Jose Pereda <jpereda at openjdk.org> wrote:
> Given a TableView with multiple and cell selection modes enabled, three different but closely related issues are tackled with this PR:
>
> - Selection history, that is used to backtrack deselection of cells, removes deselected cells, so the "second to last" cell is always up to date for second and further deselection
>
> - Selection history is also used for horizontal backtracking: deselection can go from right to left or left to right (in which case the second to last cell from the selected cells list is not correct, since these are always sorted from left to right, and top to bottom)
> - Selection history, can be reset after the selection gets replaced with a new one (meaning that there is a new anchor)
>
> Tests have been added for this three issues (in same order), for both TableView and TreeTableView
> - testSelectionPathDeviationWorks1 was already there, but ignored, and with a small bug. Tests vertical backtrack
> - testSelectionPathDeviationWorks2 tests horizontal backtrack
> - testSelectionPathDeviationWorks3 tests vertical backtrack, change of anchor, and tests vertical backtrack again
>
> The three (six) of them fail without the proposed fix, pass with it.
>
> Minor: the selection history now has a bigger size (there is no real reason to limit it to 10 cells).
The fix looks good to me.
-------------
Marked as reviewed by aghaisas (Reviewer).
PR: https://git.openjdk.org/jfx/pull/1008
More information about the openjfx-dev
mailing list