Example usage for org.apache.poi.ss.usermodel CellStyle cloneStyleFrom

List of usage examples for org.apache.poi.ss.usermodel CellStyle cloneStyleFrom

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel CellStyle cloneStyleFrom.

Prototype

void cloneStyleFrom(CellStyle source);

Source Link

Document

Clones all the style information from another CellStyle, onto this one.

Usage

From source file:workbench.db.exporter.XlsRowDataConverter.java

License:Apache License

private CellStyle geCachedStyle(CellStyle baseStyle, int column, boolean isHeader) {
    Map<Integer, CellStyle> styleCache = isHeader ? headerStyles : styles;
    CellStyle style = style = styleCache.get(column);
    if (style == null) {
        style = workbook.createCellStyle();
        style.cloneStyleFrom(baseStyle);
        styleCache.put(column, style);/*from w  w  w . java 2 s . c  o m*/
    }
    return style;
}