Example usage for org.apache.poi.hssf.usermodel HSSFCellStyle getUserStyleName

List of usage examples for org.apache.poi.hssf.usermodel HSSFCellStyle getUserStyleName

Introduction

In this page you can find the example usage for org.apache.poi.hssf.usermodel HSSFCellStyle getUserStyleName.

Prototype

public String getUserStyleName() 

Source Link

Document

Gets the name of the user defined style.

Usage

From source file:com.haulmont.yarg.formatters.impl.xls.caches.XlsStyleCache.java

License:Apache License

public void addNamedStyle(HSSFCellStyle cellStyle) {
    styleMap.put(cellStyle.getUserStyleName(), cellStyle);
}

From source file:com.haulmont.yarg.formatters.impl.XLSFormatter.java

License:Apache License

protected void initNamedStyleCache() {
    for (short i = 0; i < resultWorkbook.getNumCellStyles(); i++) {
        HSSFCellStyle cellStyle = resultWorkbook.getCellStyleAt(i);
        if (StringUtils.isNotBlank(cellStyle.getUserStyleName())) {
            styleCache.addNamedStyle(cellStyle);
        }/* w ww. ja  v  a 2  s .  co  m*/
    }
}

From source file:com.miraisolutions.xlconnect.HCellStyle.java

License:Open Source License

public static HCellStyle get(HSSFWorkbook workbook, String name) {
    HSSFWorkbook wb = (HSSFWorkbook) workbook;
    for (short i = 0; i < workbook.getNumCellStyles(); i++) {
        HSSFCellStyle cs = wb.getCellStyleAt(i);
        String userStyleName = cs.getUserStyleName();
        if (userStyleName != null && cs.getUserStyleName().equals(name))
            return new HCellStyle(workbook, cs);
    }//from   w w w.ja  va2 s.c om

    return null;
}