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 voidclearAndSelect(int arg0)voidclearAndSelect(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)voidclearSelection()voidclearSelection(int arg0)voidclearSelection(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()booleanisEmpty()booleanisSelected(int arg0)booleanisSelected(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.voidselect(int arg0)voidselect(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)voidselect(T arg0)voidselectAboveCell()voidselectAll()voidselectBelowCell()voidselectFirst()voidselectIndices(int arg0, int... arg1)voidselectLast()voidselectLeftCell()voidselectNext()voidselectPrevious()voidselectRange(int minRow, TableColumnBase<ObservableList<SpreadsheetCell>,?> minColumn, int maxRow, TableColumnBase<ObservableList<SpreadsheetCell>,?> maxColumn)voidselectRightCell()voidverifySelectedCells(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:
selectin classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
clearSelection
public void clearSelection(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)- Specified by:
clearSelectionin 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:
selectRangein classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
selectAll
public void selectAll()
-
isSelected
public boolean isSelected(int row, TableColumn<ObservableList<SpreadsheetCell>,?> column)- Specified by:
isSelectedin 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:
clearAndSelectin classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>
-
getSelectedCells
public ObservableList<TablePosition> getSelectedCells()
FIXME I don't understand why TablePosition is not parameterized in the API..- Specified by:
getSelectedCellsin classTableView.TableViewSelectionModel<ObservableList<SpreadsheetCell>>- Returns:
-
selectAboveCell
public void selectAboveCell()
- Specified by:
selectAboveCellin classTableSelectionModel<ObservableList<SpreadsheetCell>>
-
selectBelowCell
public void selectBelowCell()
- Specified by:
selectBelowCellin classTableSelectionModel<ObservableList<SpreadsheetCell>>
-
selectLeftCell
public void selectLeftCell()
- Specified by:
selectLeftCellin classTableSelectionModel<ObservableList<SpreadsheetCell>>
-
selectRightCell
public void selectRightCell()
- Specified by:
selectRightCellin classTableSelectionModel<ObservableList<SpreadsheetCell>>
-
clearSelection
public void clearSelection()
-
getSelectedIndices
public ObservableList<Integer> getSelectedIndices()
- Specified by:
getSelectedIndicesin classMultipleSelectionModel<T extends Object>
-
getSelectedItems
public ObservableList<T> getSelectedItems()
- Specified by:
getSelectedItemsin classMultipleSelectionModel<T extends Object>
-
clearAndSelect
public void clearAndSelect(int arg0)
- Specified by:
clearAndSelectin classSelectionModel<T extends Object>
-
select
public void select(int arg0)
- Specified by:
selectin classSelectionModel<T extends Object>
-
select
public void select(T arg0)
- Specified by:
selectin classSelectionModel<T extends Object>
-
selectIndices
public void selectIndices(int arg0, int... arg1)- Specified by:
selectIndicesin classMultipleSelectionModel<T extends Object>
-
selectFirst
public void selectFirst()
- Specified by:
selectFirstin classMultipleSelectionModel<T extends Object>
-
selectLast
public void selectLast()
- Specified by:
selectLastin classMultipleSelectionModel<T extends Object>
-
clearSelection
public void clearSelection(int arg0)
- Specified by:
clearSelectionin classSelectionModel<T extends Object>
-
isSelected
public boolean isSelected(int arg0)
- Specified by:
isSelectedin classSelectionModel<T extends Object>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin classSelectionModel<T extends Object>
-
selectPrevious
public void selectPrevious()
- Specified by:
selectPreviousin classSelectionModel<T extends Object>
-
selectNext
public void selectNext()
- Specified by:
selectNextin classSelectionModel<T extends Object>
-
-