private void copyTemplateForTieCommands ( final Sheet sheet ) { // if skip configuration. then return. if ( parent . isSkipConfiguration ( ) ) { return ; } Workbook wb = sheet . getWorkbook ( ) ; String copyName = TieConstants . COPY_SHEET_PREFIX + sheet . getSheetName ( ) ; if ( wb . getSheet ( copyName ) == null ) { Sheet newSheet = wb . cloneSheet ( wb . getSheetIndex ( sheet ) ) ; int sheetIndex = wb . getSheetIndex ( newSheet ) ; wb . setSheetName ( sheetIndex , copyName ) ; wb . setSheetHidden ( sheetIndex , Workbook . SHEET_STATE_VERY_HIDDEN ) ; } }
Copy the each command area to seperated sheet . As it will be used for iteration .