Class CellSelectionShifter

java.lang.Object
com.vaadin.flow.component.spreadsheet.CellSelectionShifter
All Implemented Interfaces:
Serializable

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
    Creates a new CellShifter and ties it to the given Spreadsheet
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CellSelectionShifter

      public CellSelectionShifter(Spreadsheet spreadsheet)
      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-based
      c1 - Index of the starting column, 1-based
      r2 - Index of the ending row, 1-based
      c2 - 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 cell
      newCell - Resulting new cell
      removeShifted - true to remove the source cell at the end
      sequenceIncrement - 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-based
      c - Column index of the new last selected column, 1-based