public class CellValueCommand extends SpreadsheetCommand implements ValueChangeCommand
| Modifier and Type | Field and Description |
|---|---|
protected int |
selectedcellCol |
protected int[] |
selectedCellRange |
protected int |
selectedCellRow |
protected List<Object> |
values |
activeSheetIndex, spreadsheet| Constructor and Description |
|---|
CellValueCommand(Spreadsheet spreadsheet)
Sets the currently selected cell of the spreadsheet as the selected cell
and possible painted range for this command.
|
| Modifier and Type | Method and Description |
|---|---|
void |
captureCellRangeValues(org.apache.poi.ss.util.CellRangeAddress... cellRanges)
Capture values from cells defined in the given CellRangeAddress(es).
|
void |
captureCellValues(org.apache.poi.ss.util.CellReference... cellReferences)
Capture values from cells defined in the given CellReference(s).
|
void |
clearValues()
Clears all values captured by this command.
|
void |
execute()
Executes this command.
|
protected org.apache.poi.ss.usermodel.Cell |
getCell(int r,
int c)
Returns the Cell at the given row and column.
|
protected Object |
getCellValue(org.apache.poi.ss.usermodel.Cell cell)
Returns the current value of the given Cell
|
protected Object |
getCellValue(org.apache.poi.ss.util.CellReference cell)
Returns the current value for the cell referenced by the given cell
reference
|
protected Object |
getCellValue(int r,
int c)
Returns the current value of the cell at the given coordinates.
|
Set<org.apache.poi.ss.util.CellReference> |
getChangedCells()
Returns the cells that had their value(s) changed.
|
org.apache.poi.ss.util.CellRangeAddress |
getPaintedCellRange()
The painted range that should be set when this command is run.
|
org.apache.poi.ss.util.CellReference |
getSelectedCellReference()
The selected cell that should be set when this command is run.
|
protected Object |
updateCellValue(int row,
int col,
Object value,
List<org.apache.poi.ss.usermodel.Cell> cellsToUpdate)
Sets the given value to the cell at the given coordinates.
|
getActiveSheetIndex, getSheet, setActiveSheetIndexclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetActiveSheetIndex, setActiveSheetIndexprotected final int selectedCellRow
protected final int selectedcellCol
protected final int[] selectedCellRange
public CellValueCommand(Spreadsheet spreadsheet)
spreadsheet - Target spreadsheetpublic void clearValues()
public void captureCellValues(org.apache.poi.ss.util.CellReference... cellReferences)
cellReferences - cell references to processpublic void captureCellRangeValues(org.apache.poi.ss.util.CellRangeAddress... cellRanges)
cellRanges - cell ranges to processpublic org.apache.poi.ss.util.CellReference getSelectedCellReference()
Commandnull is
returned.getSelectedCellReference in interface Commandnullpublic org.apache.poi.ss.util.CellRangeAddress getPaintedCellRange()
Commandnull is returned.getPaintedCellRange in interface Commandnullpublic void execute()
Commandprotected Object updateCellValue(int row, int col, Object value, List<org.apache.poi.ss.usermodel.Cell> cellsToUpdate)
row - Row index, 0-basedcol - Column index, 0-basedvalue - Value to set to the cellcellsToUpdate - List of cells that need updating at the end. If the cell value
is modified, the cell is added to this list.protected Object getCellValue(org.apache.poi.ss.util.CellReference cell)
cell - Reference to the cellprotected Object getCellValue(int r, int c)
r - Row index, 0-basedc - Column index, 0-basedprotected Object getCellValue(org.apache.poi.ss.usermodel.Cell cell)
cell - Target cellprotected org.apache.poi.ss.usermodel.Cell getCell(int r,
int c)
r - Row index, 0-basedc - Column index, 0-basedpublic Set<org.apache.poi.ss.util.CellReference> getChangedCells()
ValueChangeCommandgetChangedCells in interface ValueChangeCommandCopyright © 2013–2026 Vaadin Ltd. All rights reserved.