All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fastchar.extjs.utils.POIHelper Maven / Gradle / Ivy

Go to download

FastChar-ExtJs is a Java Web framework that uses extjs libraries.Quickly build a background management system

There is a newer version: 2.2.2
Show newest version
package com.fastchar.extjs.utils;

import org.apache.poi.ss.usermodel.*;

import java.util.HashMap;
import java.util.Map;

public class POIHelper {

    private final Map styleMap = new HashMap<>();

    private final Map fontMap = new HashMap<>();

    private final Workbook workbook;

    public POIHelper(Workbook workbook) {
        this.workbook = workbook;
    }

    public CellStyle getCellStyle(String key) {
        if (!styleMap.containsKey(key)) {
            CellStyle cellStyle = workbook.createCellStyle();
            styleMap.put(key, cellStyle);
        }
        return styleMap.get(key);
    }

    public Font getFont(String key) {
        if (!fontMap.containsKey(key)) {
            fontMap.put(key, workbook.createFont());
        }
        return fontMap.get(key);
    }



}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy