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.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

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 HSSFWorkbook workbook;

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

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

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


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy