Class SpreadsheetStyleFactory
- java.lang.Object
-
- com.vaadin.flow.component.spreadsheet.SpreadsheetStyleFactory
-
- All Implemented Interfaces:
Serializable
public class SpreadsheetStyleFactory extends Object implements 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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpreadsheetStyleFactory.BorderStyleStyling for cell borders
-
Constructor Summary
Constructors Constructor Description SpreadsheetStyleFactory(Spreadsheet spreadsheet)Constructs a new SpreadsheetStyleFactory for the given Spreadsheet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcellStyleUpdated(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.CellStylecreateHyperlinkCellStyle()Creates a CellStyle to be used with hyperlinksvoidloadCustomBorderStylesToState()Sets the custom border styles to shared state for sending them to the client side.voidreloadActiveSheetCellStyles()Reloads all styles for the currently active sheet.voidreloadActiveSheetColumnRowStyles()voidreloadWorkbookStyles()Reloads all sheet and cell styles from the current Workbook.
-
-
-
Constructor Detail
-
SpreadsheetStyleFactory
public SpreadsheetStyleFactory(Spreadsheet spreadsheet)
Constructs a new SpreadsheetStyleFactory for the given Spreadsheet- Parameters:
spreadsheet- Target Spreadsheet
-
-
Method Detail
-
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.
-
-