modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TableCellBehaviorBase.java
Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization
*** 1,7 ****
/*
! * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 32,43 ****
import javafx.scene.control.TableFocusModel;
import javafx.scene.control.TablePositionBase;
import javafx.scene.control.TableSelectionModel;
import javafx.scene.input.MouseButton;
- import java.util.Collections;
-
public abstract class TableCellBehaviorBase<S, T, TC extends TableColumnBase<S, ?>, C extends IndexedCell<T>> extends CellBehaviorBase<C> {
/***************************************************************************
* *
* Private fields *
--- 32,41 ----
*** 50,60 ****
* Constructors *
* *
**************************************************************************/
public TableCellBehaviorBase(C control) {
! super(control, Collections.emptyList());
}
/**************************************************************************
--- 48,58 ----
* Constructors *
* *
**************************************************************************/
public TableCellBehaviorBase(C control) {
! super(control);
}
/**************************************************************************
*** 96,106 ****
protected void doSelect(final double x, final double y, final MouseButton button,
final int clickCount, final boolean shiftDown, final boolean shortcutDown) {
// Note that table.select will reset selection
// for out of bounds indexes. So, need to check
! final C tableCell = getControl();
// If the mouse event is not contained within this tableCell, then
// we don't want to react to it.
if (! tableCell.contains(x, y)) return;
--- 94,104 ----
protected void doSelect(final double x, final double y, final MouseButton button,
final int clickCount, final boolean shiftDown, final boolean shortcutDown) {
// Note that table.select will reset selection
// for out of bounds indexes. So, need to check
! final C tableCell = getNode();
// If the mouse event is not contained within this tableCell, then
// we don't want to react to it.
if (! tableCell.contains(x, y)) return;
*** 200,210 ****
}
}
protected void simpleSelect(MouseButton button, int clickCount, boolean shortcutDown) {
final TableSelectionModel<S> sm = getSelectionModel();
! final int row = getControl().getIndex();
final TableColumnBase<S,T> column = getTableColumn();
boolean isAlreadySelected = sm.isSelected(row, column);
if (isAlreadySelected && shortcutDown) {
sm.clearSelection(row, column);
--- 198,208 ----
}
}
protected void simpleSelect(MouseButton button, int clickCount, boolean shortcutDown) {
final TableSelectionModel<S> sm = getSelectionModel();
! final int row = getNode().getIndex();
final TableColumnBase<S,T> column = getTableColumn();
boolean isAlreadySelected = sm.isSelected(row, column);
if (isAlreadySelected && shortcutDown) {
sm.clearSelection(row, column);
*** 231,241 ****
protected boolean isSelected() {
TableSelectionModel<S> sm = getSelectionModel();
if (sm == null) return false;
if (sm.isCellSelectionEnabled()) {
! final C cell = getControl();
return cell.isSelected();
} else {
return isTableRowSelected();
}
}
--- 229,239 ----
protected boolean isSelected() {
TableSelectionModel<S> sm = getSelectionModel();
if (sm == null) return false;
if (sm.isCellSelectionEnabled()) {
! final C cell = getNode();
return cell.isSelected();
} else {
return isTableRowSelected();
}
}