Class HSSFColorConverter
java.lang.Object
com.vaadin.flow.component.spreadsheet.HSSFColorConverter
- All Implemented Interfaces:
ColorConverter,Serializable
Color converter implementation for the older Excel file type (.xls or HSSF in
POI terms).
- Since:
- 1.0
- Author:
- Vaadin Ltd.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcolorStyles(org.apache.poi.ss.usermodel.CellStyle cellStyle, StringBuilder sb) Creates the appropriate CSS text and background style for the given cell style.voiddefaultColorStyles(org.apache.poi.ss.usermodel.CellStyle cellStyle, StringBuilder sb) Writes the default background and foreground colors as CSS styles from the given cell style to the given string buffer.getBackgroundColorCSS(org.apache.poi.ss.usermodel.ConditionalFormattingRule rule) Create a CSS color string for the background in the given rule.getBorderColorCSS(org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide right, String attribute, org.apache.poi.ss.usermodel.BorderFormatting borderFormatting) Returns CSS border definitions for the given conditional formatting rulegetBorderColorCSS(org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide borderSide, String attr, org.apache.poi.ss.usermodel.CellStyle cellStyle) Returns CSS border definitions for the given cell stylegetFontColorCSS(org.apache.poi.ss.usermodel.ConditionalFormattingRule rule) Create a CSS color string for the font in the given rule.booleanhasBackgroundColor(org.apache.poi.ss.usermodel.CellStyle cellStyle) Returns true if the given cell style has a background color.
-
Constructor Details
-
HSSFColorConverter
public HSSFColorConverter(org.apache.poi.hssf.usermodel.HSSFWorkbook wb)
-
-
Method Details
-
getBorderColorCSS
public String getBorderColorCSS(org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide borderSide, String attr, org.apache.poi.ss.usermodel.CellStyle cellStyle) Description copied from interface:ColorConverterReturns CSS border definitions for the given cell style- Specified by:
getBorderColorCSSin interfaceColorConverter- Parameters:
borderSide- Which side the border should goattr- What type of border style we want (solid, dashed..)cellStyle- Style for the cell
-
colorStyles
Description copied from interface:ColorConverterCreates the appropriate CSS text and background style for the given cell style.- Specified by:
colorStylesin interfaceColorConverter- Parameters:
cellStyle- The cell style.sb- to write the styles in
-
defaultColorStyles
Description copied from interface:ColorConverterWrites the default background and foreground colors as CSS styles from the given cell style to the given string buffer.- Specified by:
defaultColorStylesin interfaceColorConverter- Parameters:
cellStyle- The cell stylesb- to write the styles in
-
hasBackgroundColor
public boolean hasBackgroundColor(org.apache.poi.ss.usermodel.CellStyle cellStyle) Description copied from interface:ColorConverterReturns true if the given cell style has a background color.- Specified by:
hasBackgroundColorin interfaceColorConverter- Returns:
- Whether the given cell style has a defined background color or not.
-
getBackgroundColorCSS
Description copied from interface:ColorConverterCreate a CSS color string for the background in the given rule.- Specified by:
getBackgroundColorCSSin interfaceColorConverter- Parameters:
rule- Formatting rule- Returns:
- valid color string with semicolon or
nullif no color matches.
-
getFontColorCSS
Description copied from interface:ColorConverterCreate a CSS color string for the font in the given rule.- Specified by:
getFontColorCSSin interfaceColorConverter- Parameters:
rule- Formatting rule- Returns:
- valid color string with semicolon or
nullif no color matches.
-
getBorderColorCSS
public String getBorderColorCSS(org.apache.poi.xssf.usermodel.extensions.XSSFCellBorder.BorderSide right, String attribute, org.apache.poi.ss.usermodel.BorderFormatting borderFormatting) Description copied from interface:ColorConverterReturns CSS border definitions for the given conditional formatting rule- Specified by:
getBorderColorCSSin interfaceColorConverter- Parameters:
right- Which side the border should goattribute- What type of border style we want (solid, dashed..)borderFormatting- the active formatting
-