diff --git a/src/main/java/cokr/xit/applib/xls/StyleMaker.java b/src/main/java/cokr/xit/applib/xls/StyleMaker.java new file mode 100644 index 0000000..be6b119 --- /dev/null +++ b/src/main/java/cokr/xit/applib/xls/StyleMaker.java @@ -0,0 +1,24 @@ +package cokr.xit.applib.xls; + +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.HorizontalAlignment; + +import cokr.xit.base.docs.xls.Style; +import cokr.xit.base.docs.xls.XLSWriter; + + +public class StyleMaker { + + public static Style headerStyle(XLSWriter xlsx) { + return new Style() + .foregroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()) + .configure(styl -> { + Font font = xlsx.workbook().createFont(); + font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); + styl.font(font); + styl.alignment(HorizontalAlignment.CENTER); + }); + } + +}