Class 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
    • 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-based
        oldColumnIndex - 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 cell
        updateCustomBorders - 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.