Java Code Examples for org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt()
The following examples show how to use
org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: POIUtils.java From ermasterr with Apache License 2.0 | 7 votes |
public static HSSFCellStyle copyCellStyle(final HSSFWorkbook workbook, final HSSFCellStyle style) { final HSSFCellStyle newCellStyle = workbook.createCellStyle(); newCellStyle.setAlignment(style.getAlignment()); newCellStyle.setBorderBottom(style.getBorderBottom()); newCellStyle.setBorderLeft(style.getBorderLeft()); newCellStyle.setBorderRight(style.getBorderRight()); newCellStyle.setBorderTop(style.getBorderTop()); newCellStyle.setBottomBorderColor(style.getBottomBorderColor()); newCellStyle.setDataFormat(style.getDataFormat()); newCellStyle.setFillBackgroundColor(style.getFillBackgroundColor()); newCellStyle.setFillForegroundColor(style.getFillForegroundColor()); newCellStyle.setFillPattern(style.getFillPattern()); newCellStyle.setHidden(style.getHidden()); newCellStyle.setIndention(style.getIndention()); newCellStyle.setLeftBorderColor(style.getLeftBorderColor()); newCellStyle.setLocked(style.getLocked()); newCellStyle.setRightBorderColor(style.getRightBorderColor()); newCellStyle.setRotation(style.getRotation()); newCellStyle.setTopBorderColor(style.getTopBorderColor()); newCellStyle.setVerticalAlignment(style.getVerticalAlignment()); newCellStyle.setWrapText(style.getWrapText()); final HSSFFont font = workbook.getFontAt(style.getFontIndex()); newCellStyle.setFont(font); return newCellStyle; }
Example 2
Source File: POIUtils.java From ermaster-b with Apache License 2.0 | 5 votes |
public static HSSFCellStyle copyCellStyle(HSSFWorkbook workbook, HSSFCellStyle style) { HSSFCellStyle newCellStyle = workbook.createCellStyle(); newCellStyle.setAlignment(style.getAlignment()); newCellStyle.setBorderBottom(style.getBorderBottom()); newCellStyle.setBorderLeft(style.getBorderLeft()); newCellStyle.setBorderRight(style.getBorderRight()); newCellStyle.setBorderTop(style.getBorderTop()); newCellStyle.setBottomBorderColor(style.getBottomBorderColor()); newCellStyle.setDataFormat(style.getDataFormat()); newCellStyle.setFillBackgroundColor(style.getFillBackgroundColor()); newCellStyle.setFillForegroundColor(style.getFillForegroundColor()); newCellStyle.setFillPattern(style.getFillPattern()); newCellStyle.setHidden(style.getHidden()); newCellStyle.setIndention(style.getIndention()); newCellStyle.setLeftBorderColor(style.getLeftBorderColor()); newCellStyle.setLocked(style.getLocked()); newCellStyle.setRightBorderColor(style.getRightBorderColor()); newCellStyle.setRotation(style.getRotation()); newCellStyle.setTopBorderColor(style.getTopBorderColor()); newCellStyle.setVerticalAlignment(style.getVerticalAlignment()); newCellStyle.setWrapText(style.getWrapText()); HSSFFont font = workbook.getFontAt(style.getFontIndex()); newCellStyle.setFont(font); return newCellStyle; }
Example 3
Source File: TableSheetGenerator.java From ermasterr with Apache License 2.0 | 4 votes |
private void setIndexMatrixColor(final HSSFWorkbook workbook, final HSSFCellStyle indexStyle) { indexStyle.setFillForegroundColor(HSSFColor.WHITE.index); final HSSFFont font = workbook.getFontAt(indexStyle.getFontIndex()); font.setColor(HSSFColor.BLACK.index); }
Example 4
Source File: TableSheetGenerator.java From ermaster-b with Apache License 2.0 | 4 votes |
private void setIndexMatrixColor(HSSFWorkbook workbook, HSSFCellStyle indexStyle) { indexStyle.setFillForegroundColor(HSSFColor.WHITE.index); HSSFFont font = workbook.getFontAt(indexStyle.getFontIndex()); font.setColor(HSSFColor.BLACK.index); }