RFR: 8300893: Wrong state after deselecting two or more cells of a TableView selection
Jose Pereda
jpereda at openjdk.org
Mon Jan 23 20:55:01 UTC 2023
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).
-------------
Commit messages:
- Add more tests
- Fix and include ignored tests that are now passing
- Reset selection history, increase its size, use it also for horizontal selection, and remove deselected cells
- Allow clearing and removing elements from SizeLimitedList
Changes: https://git.openjdk.org/jfx/pull/1008/files
Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1008&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8300893
Stats: 274 lines in 4 files changed: 247 ins; 5 del; 22 mod
Patch: https://git.openjdk.org/jfx/pull/1008.diff
Fetch: git fetch https://git.openjdk.org/jfx pull/1008/head:pull/1008
PR: https://git.openjdk.org/jfx/pull/1008
More information about the openjfx-dev
mailing list