Example usage for org.apache.poi.xssf.usermodel XSSFCellStyle getFillForegroundColorColor

List of usage examples for org.apache.poi.xssf.usermodel XSSFCellStyle getFillForegroundColorColor

Introduction

In this page you can find the example usage for org.apache.poi.xssf.usermodel XSSFCellStyle getFillForegroundColorColor.

Prototype

@Override
    public XSSFColor getFillForegroundColorColor() 

Source Link

Usage

From source file:com.vaadin.addon.spreadsheet.XSSFColorConverter.java

License:Open Source License

@Override
public void defaultColorStyles(CellStyle cellStyle, StringBuilder sb) {
    XSSFCellStyle cs = (XSSFCellStyle) cellStyle;
    XSSFColor fillForegroundColorColor = cs.getFillForegroundColorColor();
    XSSFColor fillBackgroundColorColor = cs.getFillBackgroundColorColor();
    defaultBackgroundColor = styleColor(fillForegroundColorColor);
    defaultBackgroundColor = styleColor(fillBackgroundColorColor);

    if (defaultBackgroundColor == null) {
        defaultBackgroundColor = "rgba(255,255,255,1.0);";
    }/*from   ww  w  .  j a v  a2s . co  m*/
    sb.append("background-color:");
    sb.append(defaultBackgroundColor);

    XSSFColor xssfColor = cs.getFont().getXSSFColor();
    defaultColor = styleColor(xssfColor);

    if (defaultColor == null) {
        defaultColor = "rgba(0,0,0,1.0);";
    }
    sb.append("color:");
    sb.append(defaultColor);

}