com.fastchar.extjs.utils.POIHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastchar-extjs Show documentation
Show all versions of fastchar-extjs Show documentation
FastChar-ExtJs is a Java Web framework that uses extjs libraries.Quickly build a background management system
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