Class Spreadsheet.SelectionChangeEvent

java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<com.vaadin.flow.component.Component>
com.vaadin.flow.component.spreadsheet.Spreadsheet.SelectionChangeEvent
All Implemented Interfaces:
Serializable
Enclosing class:
Spreadsheet

public static class Spreadsheet.SelectionChangeEvent extends com.vaadin.flow.component.ComponentEvent<com.vaadin.flow.component.Component>
This event is fired when cell selection changes.
See Also:
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    SelectionChangeEvent(com.vaadin.flow.component.Component source, org.apache.poi.ss.util.CellReference selectedCellReference, List<org.apache.poi.ss.util.CellReference> individualSelectedCells, org.apache.poi.ss.util.CellRangeAddress selectedCellMergedRegion, List<org.apache.poi.ss.util.CellRangeAddress> cellRangeAddresses)
    Creates a new selection change event.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<org.apache.poi.ss.util.CellReference>
    Gets a combination of all selected cells.
    List<org.apache.poi.ss.util.CellRangeAddress>
    Gets all separately selected cell ranges.
    List<org.apache.poi.ss.util.CellReference>
    Gets all the individually selected single cells in the current selection.
    org.apache.poi.ss.util.CellRangeAddress
    Gets the merged region the single selected cell is a part of, if applicable.
    org.apache.poi.ss.util.CellReference
    Returns reference to the currently selected single cell OR in case of multiple selections the last cell clicked OR in case of area select the cell from which the area selection was started.
    Gets the Spreadsheet where this event happened.

    Methods inherited from class com.vaadin.flow.component.ComponentEvent

    getSource, isFromClient, unregisterListener

    Methods inherited from class java.util.EventObject

    toString

    Methods inherited from class java.lang.Object

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

    • SelectionChangeEvent

      public SelectionChangeEvent(com.vaadin.flow.component.Component source, org.apache.poi.ss.util.CellReference selectedCellReference, List<org.apache.poi.ss.util.CellReference> individualSelectedCells, org.apache.poi.ss.util.CellRangeAddress selectedCellMergedRegion, List<org.apache.poi.ss.util.CellRangeAddress> cellRangeAddresses)
      Creates a new selection change event.
      Parameters:
      source - Source Spreadsheet
      selectedCellReference - see getSelectedCellReference()
      individualSelectedCells - see getIndividualSelectedCells()
      selectedCellMergedRegion - see getSelectedCellMergedRegion()
      cellRangeAddresses - see getCellRangeAddresses()
  • Method Details

    • getSpreadsheet

      public Spreadsheet getSpreadsheet()
      Gets the Spreadsheet where this event happened.
      Returns:
      Source Spreadsheet
    • getSelectedCellReference

      public org.apache.poi.ss.util.CellReference getSelectedCellReference()
      Returns reference to the currently selected single cell OR in case of multiple selections the last cell clicked OR in case of area select the cell from which the area selection was started.
      Returns:
      CellReference to the single selected cell, or the last cell selected manually (e.g. with ctrl+mouseclick)
    • getIndividualSelectedCells

      public List<org.apache.poi.ss.util.CellReference> getIndividualSelectedCells()
      Gets all the individually selected single cells in the current selection.
      Returns:
      All non-contiguously selected cells (e.g. with ctrl+mouseclick)
    • getSelectedCellMergedRegion

      public org.apache.poi.ss.util.CellRangeAddress getSelectedCellMergedRegion()
      Gets the merged region the single selected cell is a part of, if applicable.
      Returns:
      The CellRangeAddress described the merged region the single selected cell is part of, if any.
    • getCellRangeAddresses

      public List<org.apache.poi.ss.util.CellRangeAddress> getCellRangeAddresses()
      Gets all separately selected cell ranges.
      Returns:
      All separately selected cell ranges (e.g. with ctrl+shift+mouseclick)
    • getAllSelectedCells

      public Set<org.apache.poi.ss.util.CellReference> getAllSelectedCells()
      Gets a combination of all selected cells.
      Returns:
      A combination of all selected cells, regardless of selection mode. Doesn't contain duplicates.