RFR: 8273336: Clicking a selected cell from a group of selected cells in a TableView clears the selected items list but remains selected

yosbits duke at openjdk.java.net
Sat Feb 5 07:36:59 UTC 2022


On Fri, 7 Jan 2022 19:36:45 GMT, Jose Pereda <jpereda at openjdk.org> wrote:

> This PR adds a predicate to TableView and TreeTableView selection models order to remove rows from the selection only when there are no selected cells in that given row, when cell selection is enabled.
> 
> Two tests have been added as well, that fail without this PR and pass with it.

Why not use IntPredicate?

before

``` java
public static <S> void updateSelectedIndices(MultipleSelectionModelBase<S> sm,
 ListChangeListener.Change<? extends TablePositionBase<?>> c, 
Predicate<Integer> removeRowFilter) {


after

``` java
public static <S> void updateSelectedIndices(MultipleSelectionModelBase<S> sm, 
ListChangeListener.Change<? extends TablePositionBase<?>> c, 
IntPredicate removeRowFilter) {


before
``` java
                    .map(TablePositionBase::getRow)


after
``` java
                    .mapToInt(TablePositionBase::getRow)

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

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


More information about the openjfx-dev mailing list