Module org.controlsfx.controls
Package impl.org.controlsfx.spreadsheet
Class TableViewSpanSelectionModel
- java.lang.Object
-
- javafx.scene.control.SelectionModel<T>
-
- javafx.scene.control.MultipleSelectionModel<T>
-
- javafx.scene.control.TableSelectionModel<S>
-
- javafx.scene.control.TableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
- impl.org.controlsfx.spreadsheet.TableViewSpanSelectionModel
-
public class TableViewSpanSelectionModel extends TableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
The Selection Model adapted for the SpreadsheetView regarding span.
-
-
Property Summary
-
Properties inherited from class javafx.scene.control.TableSelectionModel
cellSelectionEnabled
-
Properties inherited from class javafx.scene.control.MultipleSelectionModel
selectionMode
-
Properties inherited from class javafx.scene.control.SelectionModel
selectedIndex, selectedItem
-
-
Constructor Summary
Constructors Constructor Description TableViewSpanSelectionModel(SpreadsheetView spreadsheetView, SpreadsheetGridView cellsView)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAndSelect(int arg0)
void
clearAndSelect(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)
void
clearSelection()
void
clearSelection(int arg0)
void
clearSelection(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)
ObservableList<TablePosition>
getSelectedCells()
FIXME I don't understand why TablePosition is not parameterized in the API..ObservableList<Integer>
getSelectedIndices()
ObservableList<T>
getSelectedItems()
boolean
isEmpty()
boolean
isSelected(int arg0)
boolean
isSelected(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)
List<TablePosition<ObservableList<SpreadsheetCell>,?>>
isSelectedRange(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column, int col)
Return the tablePosition of a selected cell inside a spanned cell if any.void
select(int arg0)
void
select(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)
void
select(T arg0)
void
selectAboveCell()
void
selectAll()
void
selectBelowCell()
void
selectFirst()
void
selectIndices(int arg0, int... arg1)
void
selectLast()
void
selectLeftCell()
void
selectNext()
void
selectPrevious()
void
selectRange(int minRow, TableColumnBase<ObservableList<SpreadsheetCell>,?> minColumn, int maxRow, TableColumnBase<ObservableList<SpreadsheetCell>,?> maxColumn)
void
selectRightCell()
void
verifySelectedCells(List<Pair<Integer,Integer>> selectedCells)
When we set a new grid, we need to update the selected Cells because otherwise we will end up with TablePosition which have "-1" as their column number.-
Methods inherited from class javafx.scene.control.TableView.TableViewSelectionModel
clearAndSelect, clearSelection, focus, getFocusedIndex, getItemCount, getModelItem, getTableModel, getTableView, isSelected, select
-
Methods inherited from class javafx.scene.control.TableSelectionModel
cellSelectionEnabledProperty, isCellSelectionEnabled, setCellSelectionEnabled
-
Methods inherited from class javafx.scene.control.MultipleSelectionModel
getSelectionMode, selectionModeProperty, selectRange, setSelectionMode
-
Methods inherited from class javafx.scene.control.SelectionModel
getSelectedIndex, getSelectedItem, selectedIndexProperty, selectedItemProperty, setSelectedIndex, setSelectedItem
-
-
-
-
Constructor Detail
-
TableViewSpanSelectionModel
public TableViewSpanSelectionModel(SpreadsheetView spreadsheetView, SpreadsheetGridView cellsView)
Constructor- Parameters:
spreadsheetView
-cellsView
-
-
-
Method Detail
-
select
public void select(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)
- Specified by:
select
in classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
clearSelection
public void clearSelection(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)
- Specified by:
clearSelection
in classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
verifySelectedCells
public void verifySelectedCells(List<Pair<Integer,Integer>> selectedCells)
When we set a new grid, we need to update the selected Cells because otherwise we will end up with TablePosition which have "-1" as their column number. So we need to verify that the old selected cells are still selectable and select them.- Parameters:
selectedCells
-
-
selectRange
public void selectRange(int minRow, TableColumnBase<ObservableList<SpreadsheetCell>,?> minColumn, int maxRow, TableColumnBase<ObservableList<SpreadsheetCell>,?> maxColumn)
- Overrides:
selectRange
in classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
selectAll
public void selectAll()
-
isSelected
public boolean isSelected(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)
- Specified by:
isSelected
in classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
isSelectedRange
public List<TablePosition<ObservableList<SpreadsheetCell>,?>> isSelectedRange(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column, int col)
Return the tablePosition of a selected cell inside a spanned cell if any.- Parameters:
row
-column
-col
-- Returns:
-
clearAndSelect
public void clearAndSelect(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)
- Specified by:
clearAndSelect
in classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
getSelectedCells
public ObservableList<TablePosition> getSelectedCells()
FIXME I don't understand why TablePosition is not parameterized in the API..- Specified by:
getSelectedCells
in classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
- Returns:
-
selectAboveCell
public void selectAboveCell()
- Specified by:
selectAboveCell
in classTableSelectionModel<ObservableList<SpreadsheetCell>>
-
selectBelowCell
public void selectBelowCell()
- Specified by:
selectBelowCell
in classTableSelectionModel<ObservableList<SpreadsheetCell>>
-
selectLeftCell
public void selectLeftCell()
- Specified by:
selectLeftCell
in classTableSelectionModel<ObservableList<SpreadsheetCell>>
-
selectRightCell
public void selectRightCell()
- Specified by:
selectRightCell
in classTableSelectionModel<ObservableList<SpreadsheetCell>>
-
clearSelection
public void clearSelection()
-
getSelectedIndices
public ObservableList<Integer> getSelectedIndices()
- Specified by:
getSelectedIndices
in classMultipleSelectionModel<T extends Object>
-
getSelectedItems
public ObservableList<T> getSelectedItems()
- Specified by:
getSelectedItems
in classMultipleSelectionModel<T extends Object>
-
clearAndSelect
public void clearAndSelect(int arg0)
- Specified by:
clearAndSelect
in classSelectionModel<T extends Object>
-
select
public void select(int arg0)
- Specified by:
select
in classSelectionModel<T extends Object>
-
select
public void select(T arg0)
- Specified by:
select
in classSelectionModel<T extends Object>
-
selectIndices
public void selectIndices(int arg0, int... arg1)
- Specified by:
selectIndices
in classMultipleSelectionModel<T extends Object>
-
selectFirst
public void selectFirst()
- Specified by:
selectFirst
in classMultipleSelectionModel<T extends Object>
-
selectLast
public void selectLast()
- Specified by:
selectLast
in classMultipleSelectionModel<T extends Object>
-
clearSelection
public void clearSelection(int arg0)
- Specified by:
clearSelection
in classSelectionModel<T extends Object>
-
isSelected
public boolean isSelected(int arg0)
- Specified by:
isSelected
in classSelectionModel<T extends Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in classSelectionModel<T extends Object>
-
selectPrevious
public void selectPrevious()
- Specified by:
selectPrevious
in classSelectionModel<T extends Object>
-
selectNext
public void selectNext()
- Specified by:
selectNext
in classSelectionModel<T extends Object>
-
-