src/main/java/com/vouov/vtools/document/POIUtil.java
public static CellStyle duplicateStyle(Workbook workbook,
                                           CellStyle style) {
        CellStyle newStyle = workbook.createCellStyle();
        newStyle.setAlignment(style.getAlignment());
        newStyle.setBorderBottom(style.getBorderBottom());
        newStyle.setBorderLeft(style.getBorderLeft());
        newStyle.setBorderRight(style.getBorderRight());
        newStyle.setBorderTop(style.getBorderTop());
        newStyle.setBottomBorderColor(style.getBottomBorderColor());
        newStyle.setDataFormat(style.getDataFormat());
        newStyle.setFillBackgroundColor(style.getFillBackgroundColor());
        newStyle.setFillForegroundColor(style.getFillForegroundColor());
        newStyle.setFillPattern(style.getFillPattern());
        newStyle.setFont(workbook.getFontAt(style.getFontIndex()));
        newStyle.setHidden(style.getHidden());
        newStyle.setIndention(style.getIndention());
        newStyle.setLeftBorderColor(style.getLeftBorderColor());
        newStyle.setLocked(style.getLocked());
        newStyle.setRightBorderColor(style.getRightBorderColor());
        newStyle.setTopBorderColor(style.getTopBorderColor());
        newStyle.setVerticalAlignment(style.getVerticalAlignment());
        newStyle.setWrapText(style.getWrapText());
        return newStyle;
    }
/**
     * Duplicates given CellStyle object
     *
     * @param workbook - source Workbook object
     * @param style    - CellStyle object to duplicate
     * @return CellStyle
     */
Duplicates given CellStyle object
@param workbook - source Workbook object
@param style    - CellStyle object to duplicate
@return CellStyle
Duplicates given CellStyle object @param workbook - source Workbook object @param style - CellStyle object to duplicate @return CellStyle
public static CellStyle duplicateStyle(Workbook workbook,
                                           CellStyle style) {
        CellStyle newStyle = workbook.createCellStyle();
        newStyle.setAlignment(style.getAlignment());
        newStyle.setBorderBottom(style.getBorderBottom());
        newStyle.setBorderLeft(style.getBorderLeft());
        newStyle.setBorderRight(style.getBorderRight());
        newStyle.setBorderTop(style.getBorderTop());
        newStyle.setBottomBorderColor(style.getBottomBorderColor());
        newStyle.setDataFormat(style.getDataFormat());
        newStyle.setFillBackgroundColor(style.getFillBackgroundColor());
        newStyle.setFillForegroundColor(style.getFillForegroundColor());
        newStyle.setFillPattern(style.getFillPattern());
        newStyle.setFont(workbook.getFontAt(style.getFontIndex()));
        newStyle.setHidden(style.getHidden());
        newStyle.setIndention(style.getIndention());
        newStyle.setLeftBorderColor(style.getLeftBorderColor());
        newStyle.setLocked(style.getLocked());
        newStyle.setRightBorderColor(style.getRightBorderColor());
        newStyle.setTopBorderColor(style.getTopBorderColor());
        newStyle.setVerticalAlignment(style.getVerticalAlignment());
        newStyle.setWrapText(style.getWrapText());
        return newStyle;
    }
public static CellStyle duplicateStyle ( Workbook workbook , CellStyle style ) { CellStyle newStyle = workbook . createCellStyle ( ) ; newStyle . setAlignment ( style . getAlignment ( ) ) ; newStyle . setBorderBottom ( style . getBorderBottom ( ) ) ; newStyle . setBorderLeft ( style . getBorderLeft ( ) ) ; newStyle . setBorderRight ( style . getBorderRight ( ) ) ; newStyle . setBorderTop ( style . getBorderTop ( ) ) ; newStyle . setBottomBorderColor ( style . getBottomBorderColor ( ) ) ; newStyle . setDataFormat ( style . getDataFormat ( ) ) ; newStyle . setFillBackgroundColor ( style . getFillBackgroundColor ( ) ) ; newStyle . setFillForegroundColor ( style . getFillForegroundColor ( ) ) ; newStyle . setFillPattern ( style . getFillPattern ( ) ) ; newStyle . setFont ( workbook . getFontAt ( style . getFontIndex ( ) ) ) ; newStyle . setHidden ( style . getHidden ( ) ) ; newStyle . setIndention ( style . getIndention ( ) ) ; newStyle . setLeftBorderColor ( style . getLeftBorderColor ( ) ) ; newStyle . setLocked ( style . getLocked ( ) ) ; newStyle . setRightBorderColor ( style . getRightBorderColor ( ) ) ; newStyle . setTopBorderColor ( style . getTopBorderColor ( ) ) ; newStyle . setVerticalAlignment ( style . getVerticalAlignment ( ) ) ; newStyle . setWrapText ( style . getWrapText ( ) ) ; return newStyle ; }
Duplicates given CellStyle object
 @param workbook - source Workbook object
 @param style    - CellStyle object to duplicate
 @return CellStyle
Duplicates given CellStyle object @param workbook - source Workbook object @param style - CellStyle object to duplicate @return CellStyle