public abstract static class TableView.TableViewSelectionModel<S> extends TableSelectionModel<S>
SelectionModel
abstract class to
allow for special support for TableView controls.cellSelectionEnabledProperty
selectionModeProperty
selectedIndexProperty, selectedItemProperty
MultipleSelectionModelBase.SelectedIndicesList, MultipleSelectionModelBase.ShiftParams
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
blockFocusCall |
private TableView<S> |
tableView
*
Private fields *
*
|
selectedIndices, selectedItemChange
Constructor and Description |
---|
TableViewSelectionModel(TableView<S> tableView)
Builds a default TableViewSelectionModel instance with the provided
TableView.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
clearAndSelect(int row,
TableColumn<S,?> column)
Clears all selection, and then selects the cell at the given row/column
intersection.
|
void |
clearAndSelect(int row,
TableColumnBase<S,?> column)
Clears all selection, and then selects the cell at the given row/column
intersection.
|
abstract void |
clearSelection(int row,
TableColumn<S,?> column)
Removes selection from the specified row/column position (in view indexes).
|
void |
clearSelection(int row,
TableColumnBase<S,?> column)
Removes selection from the specified row/column position (in view indexes).
|
void |
focus(int row) |
(package private) void |
focus(int row,
TableColumn<S,?> column)
*
Private implementation *
*
|
(package private) void |
focus(TablePosition<S,?> pos) |
(package private) TablePosition<S,?> |
getFocusedCell() |
int |
getFocusedIndex() |
protected int |
getItemCount()
Returns the number of items in the data model that underpins the control.
|
protected S |
getModelItem(int index)
Returns the item at the given index.
|
abstract <any> |
getSelectedCells()
A read-only ObservableList representing the currently selected cells
in this TableView.
|
protected java.util.List<S> |
getTableModel()
Convenience method that returns getTableView().getItems().
|
TableView<S> |
getTableView()
Returns the TableView instance that this selection model is installed in.
|
abstract boolean |
isSelected(int row,
TableColumn<S,?> column)
Convenience function which tests whether the given row and column index
is currently selected in this table instance.
|
boolean |
isSelected(int row,
TableColumnBase<S,?> column)
Convenience function which tests whether the given row and column index
is currently selected in this table instance.
|
abstract void |
select(int row,
TableColumn<S,?> column)
Selects the cell at the given row/column intersection.
|
void |
select(int row,
TableColumnBase<S,?> column)
Selects the cell at the given row/column intersection.
|
void |
selectRange(int minRow,
TableColumnBase<S,?> minColumn,
int maxRow,
TableColumnBase<S,?> maxColumn)
Selects the cells in the range (minRow, minColumn) to (maxRow, maxColumn),
inclusive.
|
cellSelectionEnabledProperty, isCellSelectionEnabled, selectAboveCell, selectBelowCell, selectLeftCell, selectRightCell, setCellSelectionEnabled
clearAndSelect, clearSelection, clearSelection, getSelectedIndices, getSelectedItems, isAtomic, isEmpty, isSelected, select, select, selectAll, selectFirst, selectIndices, selectLast, selectNext, selectPrevious, shiftSelection, shiftSelection, startAtomic, stopAtomic
getSelectionMode, selectionModeProperty, selectRange, setSelectionMode
getSelectedIndex, getSelectedItem, selectedIndexProperty, selectedItemProperty, setSelectedIndex, setSelectedItem
public TableViewSelectionModel(TableView<S> tableView)
tableView
- The TableView upon which this selection model should
operate.java.lang.NullPointerException
- TableView can not be null.public abstract <any> getSelectedCells()
public boolean isSelected(int row, TableColumnBase<S,?> column)
isSelected
in class TableSelectionModel<S>
row
- the rowcolumn
- the columnpublic abstract boolean isSelected(int row, TableColumn<S,?> column)
row
- the rowcolumn
- the columnpublic void select(int row, TableColumnBase<S,?> column)
select
in class TableSelectionModel<S>
row
- the rowcolumn
- the columnpublic abstract void select(int row, TableColumn<S,?> column)
row
- the rowcolumn
- the columnpublic void clearAndSelect(int row, TableColumnBase<S,?> column)
clearAndSelect
in class TableSelectionModel<S>
row
- the rowcolumn
- the columnpublic abstract void clearAndSelect(int row, TableColumn<S,?> column)
row
- the rowcolumn
- the columnpublic void clearSelection(int row, TableColumnBase<S,?> column)
clearSelection
in class TableSelectionModel<S>
row
- the rowcolumn
- the columnpublic abstract void clearSelection(int row, TableColumn<S,?> column)
row
- the rowcolumn
- the columnpublic void selectRange(int minRow, TableColumnBase<S,?> minColumn, int maxRow, TableColumnBase<S,?> maxColumn)
selectRange
in class TableSelectionModel<S>
minRow
- the minRowminColumn
- the minColumnmaxRow
- the maxRowmaxColumn
- the maxColumnpublic TableView<S> getTableView()
protected java.util.List<S> getTableModel()
protected S getModelItem(int index)
listView.getItems().get(index)
.getModelItem
in class MultipleSelectionModelBase<S>
index
- The index of the item that is requested from the underlying
data model.protected int getItemCount()
listView.getItems().size()
. The valid range of selectable
indices is between 0 and whatever is returned by this method.getItemCount
in class MultipleSelectionModelBase<S>
public void focus(int row)
focus
in class MultipleSelectionModelBase<S>
public int getFocusedIndex()
getFocusedIndex
in class MultipleSelectionModelBase<S>
void focus(int row, TableColumn<S,?> column)
void focus(TablePosition<S,?> pos)
TablePosition<S,?> getFocusedCell()