Class SelectionHandler
- java.lang.Object
-
- com.vaadin.addon.spreadsheet.client.SelectionHandler
-
public class SelectionHandler extends Object
Class that handles finer details of cell selection inside the Spreadsheet.- Author:
- Thomas Mattsson / Vaadin Ltd.
-
-
Constructor Summary
Constructors Constructor Description SelectionHandler(SpreadsheetWidget spreadsheet, SheetWidget widget)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckNewSelectionInMergedRegion(int col, int row)Same ascheckSelectionInMergedRegion(int, int), but discards old selection in favor of the given cell.protected voidcheckSelectionInMergedRegion(int col, int row)Same ascheckNewSelectionInMergedRegion(int, int), but retains old selection in addition to the new cell.voidclearBeforeMergeCells()protected MergedRegionfindDecreasingSelection(int topRow, int bottomRow, int leftColumn, int rightColumn)Goes through the given selection and checks that the cells on the edges of the selection are not in "the beginning / middle / end" of a merged cell.voidincreaseHorizontalSelection(boolean right)voidincreaseVerticalSelection(boolean down)voidmoveSelectionDown(boolean discardSelection)voidmoveSelectionLeft(boolean discardSelection)voidmoveSelectionRight(boolean discardSelection)voidmoveSelectionUp(boolean discardSelection)voidnewSelectedCellSet()protected voidonCellSelectedWithKeyboard(int column, int row, String value, MergedRegion region)voidselectCell(String name, int col, int row, String value, boolean formula, boolean locked, boolean initialSelection)voidselectCellRange(String name, int selectedCellColumn, int selectedCellRow, int firstColumn, int lastColumn, int firstRow, int lastRow, boolean scroll)voidsetColBeforeMergedCell(int c)voidsetRowBeforeMergedCell(int r)
-
-
-
Constructor Detail
-
SelectionHandler
public SelectionHandler(SpreadsheetWidget spreadsheet, SheetWidget widget)
-
-
Method Detail
-
moveSelectionDown
public void moveSelectionDown(boolean discardSelection)
-
selectCellRange
public void selectCellRange(String name, int selectedCellColumn, int selectedCellRow, int firstColumn, int lastColumn, int firstRow, int lastRow, boolean scroll)
-
selectCell
public void selectCell(String name, int col, int row, String value, boolean formula, boolean locked, boolean initialSelection)
-
newSelectedCellSet
public void newSelectedCellSet()
-
moveSelectionUp
public void moveSelectionUp(boolean discardSelection)
-
onCellSelectedWithKeyboard
protected void onCellSelectedWithKeyboard(int column, int row, String value, MergedRegion region)
-
increaseHorizontalSelection
public void increaseHorizontalSelection(boolean right)
-
findDecreasingSelection
protected MergedRegion findDecreasingSelection(int topRow, int bottomRow, int leftColumn, int rightColumn)
Goes through the given selection and checks that the cells on the edges of the selection are not in "the beginning / middle / end" of a merged cell. Returns the correct decreased selection, after taking the merged cells into account. Parameters 1-based.- Parameters:
topRow-bottomRow-leftColumn-rightColumn-- Returns:
- merged region
-
increaseVerticalSelection
public void increaseVerticalSelection(boolean down)
-
moveSelectionRight
public void moveSelectionRight(boolean discardSelection)
-
moveSelectionLeft
public void moveSelectionLeft(boolean discardSelection)
-
checkNewSelectionInMergedRegion
protected void checkNewSelectionInMergedRegion(int col, int row)Same ascheckSelectionInMergedRegion(int, int), but discards old selection in favor of the given cell.- Parameters:
col-row-
-
checkSelectionInMergedRegion
protected void checkSelectionInMergedRegion(int col, int row)Same ascheckNewSelectionInMergedRegion(int, int), but retains old selection in addition to the new cell.
-
clearBeforeMergeCells
public void clearBeforeMergeCells()
-
setColBeforeMergedCell
public void setColBeforeMergedCell(int c)
-
setRowBeforeMergedCell
public void setRowBeforeMergedCell(int r)
-
-