public void addCellStyle ( @ Nonnull final ExcelStyle aExcelStyle ) { ValueEnforcer . notNull ( aExcelStyle , "ExcelStyle" ) ; if ( m_aLastCell == null ) throw new IllegalStateException ( "No cell present for current row!" ) ; CellStyle aCellStyle = m_aStyleCache . getCellStyle ( aExcelStyle ) ; if ( aCellStyle == null ) { aCellStyle = m_aWB . createCellStyle ( ) ; aExcelStyle . fillCellStyle ( m_aWB , aCellStyle , m_aCreationHelper ) ; m_aStyleCache . addCellStyle ( aExcelStyle , aCellStyle ) ; m_nCreatedCellStyles ++ ; } m_aLastCell . setCellStyle ( aCellStyle ) ; }
Set the cell style of the last added cell