public class SpreadsheetViewSelectionModel
extends java.lang.Object
SpreadsheetView.
Due to the complexity induced by cell's span, it is not possible to give a
full access to selectionModel like in the TableView.| Modifier and Type | Method and Description |
|---|---|
void |
clearAndSelect(int row,
SpreadsheetColumn column)
Clears all selection, and then selects the cell at the given row/column
intersection in the
SpreadsheetView. |
void |
clearAndSelect(SpreadsheetCell cell)
Clears all selection, and then selects the given
SpreadsheetCell. |
void |
clearAndSelectLeftCell()
Clears the current selection and select the cell on the left of the
current focused cell.
|
void |
clearAndSelectRightCell()
Clears the current selection and select the cell on the right of the
current focused cell.
|
void |
clearSelection()
Clears the selection model of all selected indices.
|
void |
focus(int row,
SpreadsheetColumn column)
Causes the cell at the given index to receive the focus.
|
javafx.scene.control.TablePosition |
getFocusedCell()
Returns the position of the cell that has current focus.
|
javafx.collections.ObservableList<javafx.scene.control.TablePosition> |
getSelectedCells()
Returns a read-only
ObservableList representing the currently selected cells in
this SpreadsheetView. |
javafx.scene.control.SelectionMode |
getSelectionMode()
Returns the
SelectionMode currently used. |
void |
select(int row,
SpreadsheetColumn column)
Selects the cell at the given row/column intersection.
|
void |
selectAll()
Selects all the possible cells.
|
void |
selectCells(java.util.List<javafx.util.Pair<java.lang.Integer,java.lang.Integer>> selectedCells)
Selects discontinuous cells.
|
void |
selectCells(javafx.util.Pair<java.lang.Integer,java.lang.Integer>... selectedCells)
Selects discontinuous cells.
|
void |
selectRange(int minRow,
SpreadsheetColumn minColumn,
int maxRow,
SpreadsheetColumn maxColumn)
Selects the cells in the range (minRow, minColumn) to (maxRow,
maxColumn), inclusive.
|
void |
setSelectionMode(javafx.scene.control.SelectionMode value)
Specifies the selection mode to use in this selection model.
|
public final void clearAndSelect(int row,
SpreadsheetColumn column)
SpreadsheetView. This method does not
consider sorting and filtering. If you want to select a
SpreadsheetCell in a filtered/sorted grid, use clearAndSelect(org.controlsfx.control.spreadsheet.SpreadsheetCell) instead.row - the row index to selectcolumn - the column to selectpublic final void clearAndSelect(SpreadsheetCell cell)
SpreadsheetCell.
This method allow to select a cell no matter if the Grid is Filtered or
sorted. Beware, this method can be time-consuming if lots of rows are
present.cell - the cell to selectpublic final void select(int row,
SpreadsheetColumn column)
row - the row index to selectcolumn - the column to selectpublic final void clearSelection()
public final javafx.collections.ObservableList<javafx.scene.control.TablePosition> getSelectedCells()
ObservableList representing the currently selected cells in
this SpreadsheetView.public final void selectAll()
public final javafx.scene.control.TablePosition getFocusedCell()
public final void focus(int row,
SpreadsheetColumn column)
row - the row index of the item to give focus tocolumn - the column of the item to give focus to. Can be nullpublic final void setSelectionMode(javafx.scene.control.SelectionMode value)
SelectionMode.MULTIPLE.value - the SelectionMode to usepublic javafx.scene.control.SelectionMode getSelectionMode()
SelectionMode currently used.SelectionMode currently usedpublic void selectCells(java.util.List<javafx.util.Pair<java.lang.Integer,java.lang.Integer>> selectedCells)
Pair must contain the row index as key and the column index
as value. This is useful when you want to select a great amount of cell
because it will be more efficient than calling
select(int, org.controlsfx.control.spreadsheet.SpreadsheetColumn).selectedCells - the cells to selectpublic void selectCells(javafx.util.Pair<java.lang.Integer,java.lang.Integer>... selectedCells)
Pair must contain the row index as key and the column index
as value. This is useful when you want to select a great amount of cell
because it will be more efficient than calling
select(int, org.controlsfx.control.spreadsheet.SpreadsheetColumn).selectedCells - the cells to selectpublic void selectRange(int minRow,
SpreadsheetColumn minColumn,
int maxRow,
SpreadsheetColumn maxColumn)
minRow - the minimum row in the rangeminColumn - the minimum column in the rangemaxRow - the maximum row in the rangemaxColumn - the maximum column in the rangepublic void clearAndSelectLeftCell()
public void clearAndSelectRightCell()