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
ConstructorsConstructorDescriptionSelectionChangeEvent(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 TypeMethodDescriptionSet<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.CellRangeAddressGets the merged region the single selected cell is a part of, if applicable.org.apache.poi.ss.util.CellReferenceReturns 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, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
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 SpreadsheetselectedCellReference- seegetSelectedCellReference()individualSelectedCells- seegetIndividualSelectedCells()selectedCellMergedRegion- seegetSelectedCellMergedRegion()cellRangeAddresses- seegetCellRangeAddresses()
-
-
Method Details
-
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
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
CellRangeAddressdescribed the merged region the single selected cell is part of, if any.
-
getCellRangeAddresses
Gets all separately selected cell ranges.- Returns:
- All separately selected cell ranges (e.g. with ctrl+shift+mouseclick)
-
getAllSelectedCells
Gets a combination of all selected cells.- Returns:
- A combination of all selected cells, regardless of selection mode. Doesn't contain duplicates.
-