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

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

Introduction

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

Prototype

@Internal
public CTXf getCoreXf() 

Source Link

Document

Used so that StylesSource can figure out our location

Usage

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

License:Open Source License

private XSSFColor getFillColor(XSSFCellStyle cs) {
    final CTXf _cellXf = cs.getCoreXf();
    int fillIndex = (int) _cellXf.getFillId();
    XSSFCellFill fg = workbook.getStylesSource().getFillAt(fillIndex);

    ThemesTable _theme = workbook.getTheme();
    XSSFColor fillForegroundColor = fg.getFillForegroundColor();
    if (fillForegroundColor != null && _theme != null) {
        _theme.inheritFromThemeAsRequired(fillForegroundColor);
    }/*from w  w  w .ja v  a 2  s .co  m*/
    XSSFColor fillBackgroundColor = fg.getFillBackgroundColor();
    if (fillForegroundColor == null) {
        if (fillBackgroundColor != null && _theme != null) {
            _theme.inheritFromThemeAsRequired(fillBackgroundColor);
        }
        return fillBackgroundColor;
    } else {
        return fillForegroundColor;
    }
}

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

License:Open Source License

private XSSFColor getBorderColor(XSSFCellStyle cs, BorderSide borderSide) {
    int idx = (int) cs.getCoreXf().getBorderId();
    XSSFCellBorder border = workbook.getStylesSource().getBorderAt(idx);

    return border.getBorderColor(borderSide);
}