Class CellSelectionShifter
java.lang.Object
com.vaadin.flow.component.spreadsheet.CellSelectionShifter
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionCellSelectionShifter(Spreadsheet spreadsheet) Creates a new CellShifter and ties it to the given Spreadsheet -
Method Summary
Modifier and TypeMethodDescriptionvoidonSelectionDecreasePainted(int r, int c) This method will be called when the user does a "shift" that decreases the amount of selected cells.voidonSelectionIncreasePainted(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 voidshiftCellValue(org.apache.poi.ss.usermodel.Cell shiftedCell, org.apache.poi.ss.usermodel.Cell newCell, boolean removeShifted, Double sequenceIncrement) "Shifts" cell value.
-
Constructor Details
-
CellSelectionShifter
Creates a new CellShifter and ties it to the given Spreadsheet- Parameters:
spreadsheet- Target Spreadsheet
-
-
Method Details
-
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
-