com.vaadin.flow.component.spreadsheet.
Class CellSelectionShifter
- java.lang.Object
-
- com.vaadin.flow.component.spreadsheet.CellSelectionShifter
-
All Implemented Interfaces:
public class CellSelectionShifter extends Object implements Serializable
CellSelectionShifter is an utility class for Spreadsheet which handles cell shift events. Shifting is an Excel term and means the situation where the user has selected one or more cells, and grabs the bottom right hand square of the selected area to extend or curtail the selection and fill the new area with values determined from the existing values.
Author:
Vaadin Ltd.
See Also:
-
-
Constructor Summary
Constructors Constructor Description CellSelectionShifter(Spreadsheet spreadsheet)
Creates a new CellShifter and ties it to the given Spreadsheet
-
Method Summary
All Methods Modifier and Type Method Description void
onSelectionDecreasePainted(int r, int c)
This method will be called when the user does a "shift" that decreases the amount of selected cells.
void
onSelectionIncreasePainted(int r1, int c1, int r2, int c2)
This method will be called when the user does a "shift" that increases the amount of selected cells.
protected void
shiftCellValue(org.apache.poi.ss.usermodel.Cell shiftedCell, org.apache.poi.ss.usermodel.Cell newCell, boolean removeShifted, Double sequenceIncrement)
"Shifts" cell value.
-
-
-
Constructor Detail
-
CellSelectionShifter
public CellSelectionShifter(Spreadsheet spreadsheet)
Creates a new CellShifter and ties it to the given Spreadsheet
Parameters:
spreadsheet
- Target Spreadsheet
-
-
Method Detail
-
onSelectionIncreasePainted
public void onSelectionIncreasePainted(int r1, int c1, int r2, int c2)
This method will be called when the user does a "shift" that increases the amount of selected cells.
Parameters:
r1
- Index of the starting row, 1-basedc1
- Index of the starting column, 1-basedr2
- Index of the ending row, 1-basedc2
- Index of the ending column, 1-based
-
shiftCellValue
protected void shiftCellValue(org.apache.poi.ss.usermodel.Cell shiftedCell, org.apache.poi.ss.usermodel.Cell newCell, boolean removeShifted, Double sequenceIncrement)
"Shifts" cell value. Shifting here is an Excel term and means the situation where the user has selected one or more cells, and grabs the bottom right hand square of the selected area to extend or curtail the selection and fill the new area with values determined from the existing values.
Parameters:
shiftedCell
- Source cellnewCell
- Resulting new cellremoveShifted
- true to remove the source cell at the endsequenceIncrement
- increment added to shifted cell value
-
onSelectionDecreasePainted
public void onSelectionDecreasePainted(int r, int c)
This method will be called when the user does a "shift" that decreases the amount of selected cells.
Parameters:
r
- Row index of the new last selected row, 1-basedc
- Column index of the new last selected column, 1-based
-
-