Class HSSFColorConverter
- java.lang.Object
-
- com.vaadin.flow.component.spreadsheet.HSSFColorConverter
-
- All Implemented Interfaces:
ColorConverter,Serializable
public class HSSFColorConverter extends Object implements ColorConverter
Color converter implementation for the older Excel file type (.xls or HSSF in POI terms).- Since:
- 1.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HSSFColorConverter(org.apache.poi.hssf.usermodel.HSSFWorkbook wb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcolorStyles(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.StringgetBackgroundColorCSS(org.apache.poi.ss.usermodel.ConditionalFormattingRule rule)Create a CSS color string for the background in the given rule.StringgetBorderColorCSS(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 ruleStringgetBorderColorCSS(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 styleStringgetFontColorCSS(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.
-
-
-
Method Detail
-
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
public void colorStyles(org.apache.poi.ss.usermodel.CellStyle cellStyle, StringBuilder sb)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
public void defaultColorStyles(org.apache.poi.ss.usermodel.CellStyle cellStyle, StringBuilder sb)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
public String getBackgroundColorCSS(org.apache.poi.ss.usermodel.ConditionalFormattingRule rule)
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
public String getFontColorCSS(org.apache.poi.ss.usermodel.ConditionalFormattingRule rule)
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
-
-