- 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 overridesTableViewBehaviorin 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 voiddiscontinuousSelectNextColumn()protected voiddiscontinuousSelectNextRow()protected voiddiscontinuousSelectPreviousColumn()protected voiddiscontinuousSelectPreviousRow()protected voidfocusLeftCell()protected voidfocusNextRow()protected voidfocusPreviousRow()protected voidfocusRightCell()voidselectCell(int rowDiff, int columnDiff)protected voidupdateCellHorizontalSelection(int delta, Runnable defaultAction)protected voidupdateCellVerticalSelection(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:
updateCellVerticalSelectionin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
updateCellHorizontalSelection
protected void updateCellHorizontalSelection(int delta, Runnable defaultAction)- Overrides:
updateCellHorizontalSelectionin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
focusPreviousRow
protected void focusPreviousRow()
- Overrides:
focusPreviousRowin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
focusNextRow
protected void focusNextRow()
- Overrides:
focusNextRowin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
focusLeftCell
protected void focusLeftCell()
- Overrides:
focusLeftCellin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
focusRightCell
protected void focusRightCell()
- Overrides:
focusRightCellin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
discontinuousSelectPreviousRow
protected void discontinuousSelectPreviousRow()
- Overrides:
discontinuousSelectPreviousRowin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
discontinuousSelectNextRow
protected void discontinuousSelectNextRow()
- Overrides:
discontinuousSelectNextRowin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
discontinuousSelectPreviousColumn
protected void discontinuousSelectPreviousColumn()
- Overrides:
discontinuousSelectPreviousColumnin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
discontinuousSelectNextColumn
protected void discontinuousSelectNextColumn()
- Overrides:
discontinuousSelectNextColumnin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
selectCell
public void selectCell(int rowDiff, int columnDiff)- Overrides:
selectCellin classcom.sun.javafx.scene.control.behavior.TableViewBehaviorBase<TableView<ObservableList<SpreadsheetCell>>,ObservableList<SpreadsheetCell>,TableColumn<ObservableList<SpreadsheetCell>,?>>
-
-