You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.component.spreadsheet.

Class 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:

    Serialized Form

    • 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-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