public class CellSelectionManager extends Object implements Serializable
| Constructor and Description |
|---|
CellSelectionManager(Spreadsheet spreadsheet)
Creates a new CellSelectionManager and ties it to the given Spreadsheet
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all selection data
|
List<org.apache.poi.ss.util.CellRangeAddress> |
getCellRangeAddresses()
Returns all selected areas.
|
List<org.apache.poi.ss.util.CellReference> |
getIndividualSelectedCells()
Returns references to all individually selected cells.
|
Spreadsheet.SelectionChangeEvent |
getLatestSelectionEvent()
Returns the latest selection event.
|
org.apache.poi.ss.util.CellRangeAddress |
getSelectedCellRange()
Returns the currently selected area in case there is only one area
selected.
|
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.
|
protected void |
handleCellRangeSelection(org.apache.poi.ss.util.CellRangeAddress cra) |
protected void |
handleCellRangeSelection(org.apache.poi.ss.util.CellReference startingPoint,
org.apache.poi.ss.util.CellRangeAddress cellsToSelect,
boolean scroll) |
protected void |
handleCellRangeSelection(String name,
org.apache.poi.ss.util.CellRangeAddress cra) |
protected void |
handleCellSelection(org.apache.poi.ss.util.CellReference cellReference)
Selects a single cell from the active sheet
|
protected void |
mergedRegionAdded(org.apache.poi.ss.util.CellRangeAddress region)
This is called when a merged region has been added, since the selection
may need to be updated.
|
protected void |
mergedRegionRemoved(org.apache.poi.ss.util.CellRangeAddress region)
This is called when a merged region is removed, since the selection may
need to be updated.
|
protected void |
onCellAddToSelectionAndSelected(int row,
int column)
Adds the cell at the given coordinates to the current selection.
|
protected void |
onCellRangePainted(int selectedCellRow,
int selectedCellColumn,
int row1,
int col1,
int row2,
int col2)
Sets the given range and starting point as the current selection.
|
protected void |
onCellRangeSelected(int row1,
int col1,
int row2,
int col2)
Sets the given range as the current selection.
|
protected void |
onCellsAddedToRangeSelection(int row1,
int col1,
int row2,
int col2)
This is called when a cell range has been added to the current selection.
|
protected void |
onCellSelected(int row,
int column,
boolean discardOldRangeSelection)
Sets/adds the cell at the given coordinates as/to the current selection.
|
protected void |
onColumnAddedToSelection(int firstRowIndex,
int column)
This is called when a column has been added to the current selection
|
protected void |
onColumnSelected(int firstRowIndex,
int column)
This is called when a column has made the current selection
|
protected void |
onRowAddedToRangeSelection(int row,
int firstColumnIndex)
This is called when a row has been added to the current selection
|
protected void |
onRowSelected(int row,
int firstColumnIndex)
This is called when a row has been made the current selection
|
protected void |
onSheetAddressChanged(String value,
boolean initialSelection)
This is called when the sheet's address field has been changed and the
sheet selection and function field must be updated.
|
protected void |
reloadCurrentSelection()
Reloads the current selection, but does not take non-coherent selection
into account - discards multiple cell ranges and individually selected
cells.
|
protected void |
reSelectSelectedCell()
Reselects the currently selected single cell
|
public CellSelectionManager(Spreadsheet spreadsheet)
spreadsheet - public void clear()
public org.apache.poi.ss.util.CellReference getSelectedCellReference()
public org.apache.poi.ss.util.CellRangeAddress getSelectedCellRange()
public List<org.apache.poi.ss.util.CellReference> getIndividualSelectedCells()
public List<org.apache.poi.ss.util.CellRangeAddress> getCellRangeAddresses()
public Spreadsheet.SelectionChangeEvent getLatestSelectionEvent()
protected void reloadCurrentSelection()
protected void onCellSelected(int row,
int column,
boolean discardOldRangeSelection)
row - Row index, 1-basedcolumn - Column index, 1-baseddiscardOldRangeSelection - true to discard previous selections, false to add to the
current selectionprotected void onSheetAddressChanged(String value, boolean initialSelection)
value - New value of the address fieldprotected void reSelectSelectedCell()
protected void handleCellSelection(org.apache.poi.ss.util.CellReference cellReference)
cellReference - Reference to the cell to be selectedprotected void handleCellRangeSelection(org.apache.poi.ss.util.CellRangeAddress cra)
protected void handleCellRangeSelection(String name, org.apache.poi.ss.util.CellRangeAddress cra)
protected void handleCellRangeSelection(org.apache.poi.ss.util.CellReference startingPoint,
org.apache.poi.ss.util.CellRangeAddress cellsToSelect,
boolean scroll)
protected void onCellRangeSelected(int row1,
int col1,
int row2,
int col2)
row1 - Starting row index, 1-basedcol1 - Starting column index, 1-basedrow2 - Ending row index, 1-basedcol2 - Ending column index, 1-basedprotected void onCellRangePainted(int selectedCellRow,
int selectedCellColumn,
int row1,
int col1,
int row2,
int col2)
selectedCellRow - Index of the row where the paint was started, 1-basedselectedCellColumn - Index of the column where the paint was started, 1-basedrow1 - Starting row index, 1-basedcol1 - Starting column index, 1-basedrow2 - Ending row index, 1-basedcol2 - Ending column index, 1-basedprotected void onCellAddToSelectionAndSelected(int row,
int column)
row - Row index, 1-basedcolumn - Column index, 1-basedprotected void onCellsAddedToRangeSelection(int row1,
int col1,
int row2,
int col2)
row1 - Starting row index, 1-basedcol1 - Starting column index, 1-basedrow2 - Ending row index, 1-basedcol2 - Ending column index, 1-basedprotected void onRowSelected(int row,
int firstColumnIndex)
row - Index of target row, 1-basedfirstColumnIndex - Index of first column, 1-basedprotected void onRowAddedToRangeSelection(int row,
int firstColumnIndex)
row - Index of target row, 1-basedfirstColumnIndex - Index of first column, 1-basedprotected void onColumnSelected(int firstRowIndex,
int column)
firstRowIndex - Index of first row, 1-basedcolumn - Index of target column, 1-basedprotected void onColumnAddedToSelection(int firstRowIndex,
int column)
firstRowIndex - Index of first row, 1-basedcolumn - Index of target column, 1-basedprotected void mergedRegionAdded(org.apache.poi.ss.util.CellRangeAddress region)
region - Merged region that was addedprotected void mergedRegionRemoved(org.apache.poi.ss.util.CellRangeAddress region)
region - Merged region that was removedCopyright © 2013–2026 Vaadin Ltd. All rights reserved.