Search in sources :

Example 1 with WriteWorkbookHolder

use of com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder in project easyexcel by alibaba.

the class FillStyleCellWriteHandler method afterCellDispose.

@Override
public void afterCellDispose(CellWriteHandlerContext context) {
    if (BooleanUtils.isTrue(context.getIgnoreFillStyle())) {
        return;
    }
    WriteCellData<?> cellData = context.getFirstCellData();
    if (cellData == null) {
        return;
    }
    WriteCellStyle writeCellStyle = cellData.getWriteCellStyle();
    CellStyle originCellStyle = cellData.getOriginCellStyle();
    if (writeCellStyle == null && originCellStyle == null) {
        return;
    }
    WriteWorkbookHolder writeWorkbookHolder = context.getWriteWorkbookHolder();
    context.getCell().setCellStyle(writeWorkbookHolder.createCellStyle(writeCellStyle, originCellStyle));
}
Also used : WriteWorkbookHolder(com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder) WriteCellStyle(com.alibaba.excel.write.metadata.style.WriteCellStyle) CellStyle(org.apache.poi.ss.usermodel.CellStyle) WriteCellStyle(com.alibaba.excel.write.metadata.style.WriteCellStyle)

Example 2 with WriteWorkbookHolder

use of com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder in project easyexcel by alibaba.

the class WriteContextImpl method initCurrentWorkbookHolder.

private void initCurrentWorkbookHolder(WriteWorkbook writeWorkbook) {
    writeWorkbookHolder = new WriteWorkbookHolder(writeWorkbook);
    currentWriteHolder = writeWorkbookHolder;
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("CurrentConfiguration is writeWorkbookHolder");
    }
}
Also used : WriteWorkbookHolder(com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder)

Aggregations

WriteWorkbookHolder (com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder)2 WriteCellStyle (com.alibaba.excel.write.metadata.style.WriteCellStyle)1 CellStyle (org.apache.poi.ss.usermodel.CellStyle)1