Class SpreadsheetHandlerImpl
java.lang.Object
com.vaadin.flow.component.spreadsheet.SpreadsheetHandlerImpl
- All Implemented Interfaces:
GroupingHandler,SpreadsheetHandler,SpreadsheetServerRpc
Implementation of the Spreadsheet Server RPC interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionOnColumnHeader(String actionKey) The action was selected from context menu for the column header.voidactionOnCurrentSelection(String actionKey) The action was selected from context menu for the current selection.voidactionOnRowHeader(String actionKey) The action was selected from context menu for the row header.voidcellAddedToSelectionAndSelected(int row, int column) Single cell added to selection.voidcellRangePainted(int selectedCellRow, int selectedCellColumn, int row1, int col1, int row2, int col2) Cell range selected by paintingvoidcellRangeSelected(int row1, int col1, int row2, int col2) Cell range selected from scratch.voidcellsAddedToRangeSelection(int row1, int col1, int row2, int col2) Multiple cells added to previous range selection.voidcellSelected(int row, int column, boolean discardOldRangeSelection) Single cell selected inside sheet.voidcellValueEdited(int row, int col, String value) voidCalled after successful cut operation; currently selected cells should be clearedvoidcolumnAddedToSelection(int firstRowIndex, int column) Complete column added to previous range selection.voidcolumnHeaderContextMenuOpen(int columnIndex) Context menu should be created for the column.voidcolumnResized(Map<Integer, Integer> newColumnSizes, int row1, int col1, int row2, int col2) Columns resized with drag and drop.voidcolumnSelected(int col, int firstRowIndex) Complete column selected.voidcontextMenuOpenOnSelection(int row, int column) Context menu should be created for the appropriate selection.voidDelete the contents of the selected cells, do not remove style/formatting.org.apache.poi.ss.usermodel.CellgetOrCreateCell(org.apache.poi.ss.usermodel.Sheet sheet, int rowIdx, int colIdx) voidlevelHeaderClicked(boolean isCols, int level) voidlinkCellClicked(int row, int column) A cell containing a hyperlink has been clicked.voidonColumnAutofit(int columnIndex) Column autofit with double click on the column header resizing area.voidCalled when the client side connector has been initialized.voidClient pasted text at current selection.voidonPopupButtonClick(int row, int column) voidonPopupClose(int row, int column) voidonRedo()Client pressed redo ctrl/meta+yvoidonRowAutofit(int rowIndex) Row autofit with double click on the row header resizing area.voidonSheetScroll(int firstRow, int firstColumn, int lastRow, int lastColumn) These cells have become visible and possibly need the content, if has not been given previously or has not changed.voidonUndo()Client pressed undo ctrl/meta+zvoidClient tried to modify protected cellvoidrowAddedToRangeSelection(int row, int firstColumnIndex) Complete row added to previous range selection.voidrowHeaderContextMenuOpen(int rowIndex) Context menu should be created for the row.voidrowSelected(int row, int firstColumnIndex) Complete row selected.voidrowsResized(Map<Integer, Float> newRowSizes, int row1, int col1, int row2, int col2) Rows resized with header drag and drop.voidselectionDecreasePainted(int r, int c) The existing selection has been painted inwards meaning that the painted selection cells should be cleared.voidselectionIncreasePainted(int r1, int c1, int r2, int c2) The new selection that was painted from the old.voidsetCellStyleWidthRatios(HashMap<Integer, Float> cellStyleWidthRatioMap) voidsetGroupingCollapsed(boolean isCols, int colIndex, boolean collapsed) voidsheetAddressChanged(String value) Address field value changed.voidsheetCreated(int scrollLeft, int scrollTop) Sheet is created as the last sheetvoidsheetRenamed(int sheetIndex, String sheetName) voidsheetSelected(int tabIndex, int scrollLeft, int scrollTop) voidupdateCellComment(String text, int col, int row)
-
Constructor Details
-
SpreadsheetHandlerImpl
-
-
Method Details
-
onSheetScroll
public void onSheetScroll(int firstRow, int firstColumn, int lastRow, int lastColumn) Description copied from interface:SpreadsheetHandlerThese cells have become visible and possibly need the content, if has not been given previously or has not changed.- Specified by:
onSheetScrollin interfaceSpreadsheetHandler
-
cellSelected
public void cellSelected(int row, int column, boolean discardOldRangeSelection) Description copied from interface:SpreadsheetHandlerSingle cell selected inside sheet.- Specified by:
cellSelectedin interfaceSpreadsheetHandler
-
sheetAddressChanged
Description copied from interface:SpreadsheetHandlerAddress field value changed.- Specified by:
sheetAddressChangedin interfaceSpreadsheetHandler
-
cellRangeSelected
public void cellRangeSelected(int row1, int col1, int row2, int col2) Description copied from interface:SpreadsheetHandlerCell range selected from scratch. Actual selected cell not changed.- Specified by:
cellRangeSelectedin interfaceSpreadsheetHandler
-
cellRangePainted
public void cellRangePainted(int selectedCellRow, int selectedCellColumn, int row1, int col1, int row2, int col2) Description copied from interface:SpreadsheetHandlerCell range selected by painting- Specified by:
cellRangePaintedin interfaceSpreadsheetHandler- Parameters:
selectedCellRow-selectedCellColumn-row1-col1-row2-col2-
-
cellAddedToSelectionAndSelected
public void cellAddedToSelectionAndSelected(int row, int column) Description copied from interface:SpreadsheetHandlerSingle cell added to selection. Selection changed to this.- Specified by:
cellAddedToSelectionAndSelectedin interfaceSpreadsheetHandler
-
cellsAddedToRangeSelection
public void cellsAddedToRangeSelection(int row1, int col1, int row2, int col2) Description copied from interface:SpreadsheetHandlerMultiple cells added to previous range selection. Actual selected cell not changed.- Specified by:
cellsAddedToRangeSelectionin interfaceSpreadsheetHandler
-
rowSelected
public void rowSelected(int row, int firstColumnIndex) Description copied from interface:SpreadsheetHandlerComplete row selected. New selected cell is at firstColumnIndex:row.- Specified by:
rowSelectedin interfaceSpreadsheetHandler- Parameters:
row- the row that was selectedfirstColumnIndex- column index for the selected cell (left most visible)
-
rowAddedToRangeSelection
public void rowAddedToRangeSelection(int row, int firstColumnIndex) Description copied from interface:SpreadsheetHandlerComplete row added to previous range selection. New selected cell is at firstColumnIndex:row.- Specified by:
rowAddedToRangeSelectionin interfaceSpreadsheetHandler- Parameters:
row- the row that was selectedfirstColumnIndex- column index for the selected cell (left most visible)
-
columnSelected
public void columnSelected(int col, int firstRowIndex) Description copied from interface:SpreadsheetHandlerComplete column selected. New selected cell is at column:firstRowIndex.- Specified by:
columnSelectedin interfaceSpreadsheetHandler- Parameters:
col- the column that was selectedfirstRowIndex- row index for the selected cell (top most visible)
-
columnAddedToSelection
public void columnAddedToSelection(int firstRowIndex, int column) Description copied from interface:SpreadsheetHandlerComplete column added to previous range selection. New selected cell is at column:firstRowIndex.- Specified by:
columnAddedToSelectionin interfaceSpreadsheetHandler- Parameters:
firstRowIndex- row index for the selected cell (top most)column- the column that was selected
-
selectionIncreasePainted
public void selectionIncreasePainted(int r1, int c1, int r2, int c2) Description copied from interface:SpreadsheetHandlerThe new selection that was painted from the old. Values and formulas should be painted to the new selection.- Specified by:
selectionIncreasePaintedin interfaceSpreadsheetHandler- Parameters:
r1- new selection top, 1-basedc1- new selection left, 1-basedr2- new selection bottom, 1-basedc2- new selection right, 1-based
-
selectionDecreasePainted
public void selectionDecreasePainted(int r, int c) Description copied from interface:SpreadsheetHandlerThe existing selection has been painted inwards meaning that the painted selection cells should be cleared.- Specified by:
selectionDecreasePaintedin interfaceSpreadsheetHandler- Parameters:
r- topmost cell index where the clearing starts, 1-basedc- leftmost cell index where the clearing starts, 1-based
-
cellValueEdited
- Specified by:
cellValueEditedin interfaceSpreadsheetHandler
-
sheetSelected
public void sheetSelected(int tabIndex, int scrollLeft, int scrollTop) - Specified by:
sheetSelectedin interfaceSpreadsheetHandler- Parameters:
tabIndex- 0-basedscrollLeft-scrollTop-
-
sheetRenamed
- Specified by:
sheetRenamedin interfaceSpreadsheetHandler- Parameters:
sheetIndex- 0-basedsheetName-
-
sheetCreated
public void sheetCreated(int scrollLeft, int scrollTop) Description copied from interface:SpreadsheetHandlerSheet is created as the last sheet- Specified by:
sheetCreatedin interfaceSpreadsheetHandler- Parameters:
scrollLeft-scrollTop-
-
deleteSelectedCells
public void deleteSelectedCells()Description copied from interface:SpreadsheetHandlerDelete the contents of the selected cells, do not remove style/formatting.- Specified by:
deleteSelectedCellsin interfaceSpreadsheetHandler
-
linkCellClicked
public void linkCellClicked(int row, int column) Description copied from interface:SpreadsheetHandlerA cell containing a hyperlink has been clicked.- Specified by:
linkCellClickedin interfaceSpreadsheetHandler- Parameters:
row- 1-basedcolumn- 1-based
-
contextMenuOpenOnSelection
public void contextMenuOpenOnSelection(int row, int column) Description copied from interface:SpreadsheetServerRpcContext menu should be created for the appropriate selection.Selection can change if the cell at the given indexes isn't included in the previous selection.
- Specified by:
contextMenuOpenOnSelectionin interfaceSpreadsheetServerRpc- Parameters:
row- 1-basedcolumn- 1-based
-
rowHeaderContextMenuOpen
public void rowHeaderContextMenuOpen(int rowIndex) Description copied from interface:SpreadsheetServerRpcContext menu should be created for the row.- Specified by:
rowHeaderContextMenuOpenin interfaceSpreadsheetServerRpc- Parameters:
rowIndex- 1-based
-
columnHeaderContextMenuOpen
public void columnHeaderContextMenuOpen(int columnIndex) Description copied from interface:SpreadsheetServerRpcContext menu should be created for the column.- Specified by:
columnHeaderContextMenuOpenin interfaceSpreadsheetServerRpc- Parameters:
columnIndex- 1-based
-
actionOnCurrentSelection
Description copied from interface:SpreadsheetServerRpcThe action was selected from context menu for the current selection.- Specified by:
actionOnCurrentSelectionin interfaceSpreadsheetServerRpc- Parameters:
actionKey-
-
actionOnRowHeader
Description copied from interface:SpreadsheetServerRpcThe action was selected from context menu for the row header.- Specified by:
actionOnRowHeaderin interfaceSpreadsheetServerRpc- Parameters:
actionKey-
-
actionOnColumnHeader
Description copied from interface:SpreadsheetServerRpcThe action was selected from context menu for the column header.- Specified by:
actionOnColumnHeaderin interfaceSpreadsheetServerRpc- Parameters:
actionKey-
-
rowsResized
Description copied from interface:SpreadsheetHandlerRows resized with header drag and drop. Indexes 1-based.- Specified by:
rowsResizedin interfaceSpreadsheetHandler- Parameters:
newRowSizes- row index and new size (converted pt)row1-col1-row2-col2-
-
columnResized
public void columnResized(Map<Integer, Integer> newColumnSizes, int row1, int col1, int row2, int col2) Description copied from interface:SpreadsheetHandlerColumns resized with drag and drop. Indexes 1-based.- Specified by:
columnResizedin interfaceSpreadsheetHandler- Parameters:
newColumnSizes- column index and new size (px)row1-col1-row2-col2-
-
onRowAutofit
public void onRowAutofit(int rowIndex) Description copied from interface:SpreadsheetHandlerRow autofit with double click on the row header resizing area.- Specified by:
onRowAutofitin interfaceSpreadsheetHandler- Parameters:
rowIndex- 1-based
-
onColumnAutofit
public void onColumnAutofit(int columnIndex) Description copied from interface:SpreadsheetHandlerColumn autofit with double click on the column header resizing area.- Specified by:
onColumnAutofitin interfaceSpreadsheetHandler- Parameters:
columnIndex- 1-based
-
onUndo
public void onUndo()Description copied from interface:SpreadsheetHandlerClient pressed undo ctrl/meta+z- Specified by:
onUndoin interfaceSpreadsheetHandler
-
onRedo
public void onRedo()Description copied from interface:SpreadsheetHandlerClient pressed redo ctrl/meta+y- Specified by:
onRedoin interfaceSpreadsheetHandler
-
setCellStyleWidthRatios
- Specified by:
setCellStyleWidthRatiosin interfaceSpreadsheetHandler
-
onConnectorInit
public void onConnectorInit()Description copied from interface:SpreadsheetServerRpcCalled when the client side connector has been initialized. This is for making sure that the non-state related stuff is cleared from server side when needed, because non state stuff is not resent to client when the component is attached again. Thus this marks that cached should be cleared etc.- Specified by:
onConnectorInitin interfaceSpreadsheetServerRpc
-
protectedCellWriteAttempted
public void protectedCellWriteAttempted()Description copied from interface:SpreadsheetHandlerClient tried to modify protected cell- Specified by:
protectedCellWriteAttemptedin interfaceSpreadsheetHandler
-
onPaste
Description copied from interface:SpreadsheetHandlerClient pasted text at current selection.- Specified by:
onPastein interfaceSpreadsheetHandler- Parameters:
text-
-
clearSelectedCellsOnCut
public void clearSelectedCellsOnCut()Description copied from interface:SpreadsheetHandlerCalled after successful cut operation; currently selected cells should be cleared- Specified by:
clearSelectedCellsOnCutin interfaceSpreadsheetHandler
-
updateCellComment
- Specified by:
updateCellCommentin interfaceSpreadsheetHandler
-
getOrCreateCell
public org.apache.poi.ss.usermodel.Cell getOrCreateCell(org.apache.poi.ss.usermodel.Sheet sheet, int rowIdx, int colIdx) -
setGroupingCollapsed
public void setGroupingCollapsed(boolean isCols, int colIndex, boolean collapsed) - Specified by:
setGroupingCollapsedin interfaceGroupingHandler
-
levelHeaderClicked
public void levelHeaderClicked(boolean isCols, int level) - Specified by:
levelHeaderClickedin interfaceGroupingHandler
-
onPopupButtonClick
public void onPopupButtonClick(int row, int column) -
onPopupClose
public void onPopupClose(int row, int column)
-