- java.lang.Object
-
- com.sun.javafx.scene.control.behavior.BehaviorBase<C>
-
- com.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<T>,T,TableColumn<T,?>>
-
- com.sun.javafx.scene.control.behavior.TableViewBehavior<ObservableList<SpreadsheetCell>>
-
- impl.org.controlsfx.spreadsheet.GridViewBehavior
-
public class GridViewBehavior extends com.sun.javafx.scene.control.behavior.TableViewBehavior<ObservableList<SpreadsheetCell>>
This overridesTableViewBehavior
in order to modify the selection behavior. The selection will basically work like Excel: Selection will always be rectangles. So selection by SHIFT will produce a rectangle extending your selection. Pressing SHORTCUT with an arrow will on a cell will do: - If the cell is empty, we go to the next (in the direction) non empty cell. - If the cell is not empty, then we either go to the last non empty cell if the next is not empty, or the first non empty cell if the next is empty. This is meant to increase navigation on non empty cell in a Spreadsheet more easily. Pressing SHORTCUT and SHIFT together will behave as the ShortCut previously explained but the selection will be extended instead of just selecting the new cell.
-
-
Constructor Summary
Constructors Constructor Description GridViewBehavior(TableView<ObservableList<SpreadsheetCell>> control)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
discontinuousSelectNextColumn()
protected void
discontinuousSelectNextRow()
protected void
discontinuousSelectPreviousColumn()
protected void
discontinuousSelectPreviousRow()
protected void
focusLeftCell()
protected void
focusNextRow()
protected void
focusPreviousRow()
protected void
focusRightCell()
void
selectCell(int rowDiff, int columnDiff)
protected void
updateCellHorizontalSelection(int delta, Runnable defaultAction)
protected void
updateCellVerticalSelection(int delta, Runnable defaultAction)
-
Methods inherited from class com.sun.javafx.scene.control.behavior.TableViewBehavior
dispose, editCell, getFocusedCell, getFocusModel, getItemCount, getSelectedCells, getSelectionModel, getTablePosition, getVisibleLeafColumn, getVisibleLeafColumns, getVisibleLeafIndex, isControlEditable, selectAllToFocus
-
Methods inherited from class com.sun.javafx.scene.control.behavior.TableViewBehaviorBase
activate, alsoSelectLeftCell, alsoSelectNext, alsoSelectPrevious, alsoSelectRightCell, cancelEdit, clearSelection, clearSelectionOutsideRange, discontinuousSelectAllToFirstRow, discontinuousSelectAllToLastRow, discontinuousSelectPageDown, discontinuousSelectPageUp, focusFirstRow, focusLastRow, focusPageDown, focusPageUp, getAnchor, getColumn, getColumn, getInputMap, hasAnchor, isRTL, mousePressed, scrollDown, scrollUp, selectAll, selectAllPageDown, selectAllPageUp, selectAllToFirstRow, selectAllToLastRow, selectFirstRow, selectLastRow, selectLeftCell, selectNextRow, selectPreviousRow, selectRightCell, setAnchor, setAnchor, setOnFocusLeftCell, setOnFocusNextRow, setOnFocusPreviousRow, setOnFocusRightCell, setOnMoveToFirstCell, setOnMoveToLastCell, setOnScrollPageDown, setOnScrollPageUp, setOnSelectLeftCell, setOnSelectNextRow, setOnSelectPreviousRow, setOnSelectRightCell, toggleFocusOwnerSelection, updateRowSelection
-
-
-
-
Constructor Detail
-
GridViewBehavior
public GridViewBehavior(TableView<ObservableList<SpreadsheetCell>> control)
-
-
Method Detail
-
updateCellVerticalSelection
protected void updateCellVerticalSelection(int delta, Runnable defaultAction)
- Overrides:
updateCellVerticalSelection
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
updateCellHorizontalSelection
protected void updateCellHorizontalSelection(int delta, Runnable defaultAction)
- Overrides:
updateCellHorizontalSelection
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
focusPreviousRow
protected void focusPreviousRow()
- Overrides:
focusPreviousRow
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
focusNextRow
protected void focusNextRow()
- Overrides:
focusNextRow
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
focusLeftCell
protected void focusLeftCell()
- Overrides:
focusLeftCell
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
focusRightCell
protected void focusRightCell()
- Overrides:
focusRightCell
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
discontinuousSelectPreviousRow
protected void discontinuousSelectPreviousRow()
- Overrides:
discontinuousSelectPreviousRow
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
discontinuousSelectNextRow
protected void discontinuousSelectNextRow()
- Overrides:
discontinuousSelectNextRow
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
discontinuousSelectPreviousColumn
protected void discontinuousSelectPreviousColumn()
- Overrides:
discontinuousSelectPreviousColumn
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
discontinuousSelectNextColumn
protected void discontinuousSelectNextColumn()
- Overrides:
discontinuousSelectNextColumn
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
selectCell
public void selectCell(int rowDiff, int columnDiff)
- Overrides:
selectCell
in classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
-