Class SpreadsheetStyleFactory
java.lang.Object
com.vaadin.flow.component.spreadsheet.SpreadsheetStyleFactory
- All Implemented Interfaces:
Serializable
SpreadsheetStyleFactory is an utility class for the Spreadsheet component.
This class handles converting Apache POI CellStyles to CSS styles.
- Author:
- Vaadin Ltd.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumStyling for cell borders -
Constructor Summary
ConstructorsConstructorDescriptionSpreadsheetStyleFactory(Spreadsheet spreadsheet) Constructs a new SpreadsheetStyleFactory for the given Spreadsheet -
Method Summary
Modifier and TypeMethodDescriptionvoidcellStyleUpdated(org.apache.poi.ss.usermodel.Cell cell, boolean updateCustomBorders) This should be called when a Cell's styling has been changed.voidclearCellStyle(int oldRowIndex, int oldColumnIndex) Clears all styles for the given cell.org.apache.poi.ss.usermodel.CellStyleCreates a CellStyle to be used with hyperlinksvoidSets the custom border styles to shared state for sending them to the client side.voidReloads all styles for the currently active sheet.voidvoidReloads all sheet and cell styles from the current Workbook.
-
Constructor Details
-
SpreadsheetStyleFactory
Constructs a new SpreadsheetStyleFactory for the given Spreadsheet- Parameters:
spreadsheet- Target Spreadsheet
-
-
Method Details
-
reloadWorkbookStyles
public void reloadWorkbookStyles()Reloads all sheet and cell styles from the current Workbook. -
reloadActiveSheetColumnRowStyles
public void reloadActiveSheetColumnRowStyles() -
createHyperlinkCellStyle
public org.apache.poi.ss.usermodel.CellStyle createHyperlinkCellStyle()Creates a CellStyle to be used with hyperlinks- Returns:
- A new hyperlink CellStyle
-
clearCellStyle
public void clearCellStyle(int oldRowIndex, int oldColumnIndex) Clears all styles for the given cell. Should be used when i.e. a cell has been shifted (the old location is cleared of all styles).- Parameters:
oldRowIndex- 0-basedoldColumnIndex- 0-based
-
cellStyleUpdated
public void cellStyleUpdated(org.apache.poi.ss.usermodel.Cell cell, boolean updateCustomBorders) This should be called when a Cell's styling has been changed. This will tell the Spreadsheet to send the change to the client side.- Parameters:
cell- Target cellupdateCustomBorders- true to also update custom borders
-
loadCustomBorderStylesToState
public void loadCustomBorderStylesToState()Sets the custom border styles to shared state for sending them to the client side. -
reloadActiveSheetCellStyles
public void reloadActiveSheetCellStyles()Reloads all styles for the currently active sheet.
-