Package com.brsanthu.dataexporter.model

Examples of com.brsanthu.dataexporter.model.DataExporterCallback


        }
       
        //Generate all row data as required.
        generateRowData(rowDetails);
       
        DataExporterCallback callback = rowDetails.getTable().getCallback();
        if (callback != null) {
            callback.beforeRow(rowDetails);
        }

        //Format the row into cells
        List<List<String>> rowCells = formatRowCells(rowDetails);
       
        //Render left row divider
        printLine(getStyle().getCenterLeftDivider(), getStyle().getCenterLeftRightDivider(),
            getStyle().getCenterCenterDivider(), getStyle().getCenterRightLeftDivider(),
            getStyle().getCenterRightDivider(), rowCells);
       
        if (callback != null) {
            callback.afterRow(rowDetails);
        }
    }
View Full Code Here


        printBottomBorder();
    }
   
    public List<List<String>> formatRowCells(RowDetails rowDetails) {
       
        DataExporterCallback callback = rowDetails.getTable().getCallback();

        int maxRowHeight = Math.max(getTextTableExportOptions().getMinRowHeight(), getMaxRowHeight(rowDetails));
       
        List<List<String>> rowLines = new ArrayList<List<String>>();
        for (int j = 0; j < maxRowHeight; j++) {
            rowLines.add(new ArrayList<String>());
        }

        for (int columnIndex = 0; columnIndex < columns.size(); columnIndex++) {
            Column column = columns.get(columnIndex);
           
            CellDetails cellDetails = new CellDetails(rowDetails, columnIndex);
            cellDetails.setRowHeight(maxRowHeight);
            cellDetails.setCellValue(rowDetails.getRow().getCellValue(cellDetails));
            cellDetails.setCellAlign(cellDetails.getColumn().getAlign());
           
            if (callback != null) {
                callback.beforeCell(cellDetails);
            }

            List<String> cells = column.align(cellDetails, column.format(cellDetails));
            for (int j = 0; j < maxRowHeight; j++) {
                rowLines.get(j).add(cells.get(j));
            }

            if (callback != null) {
                callback.afterCell(cellDetails);
            }
        }
       
        return rowLines;
    }
View Full Code Here

        Util.checkForNotNull(rowDetails, "rowDetails");
       
        //Generate the row data
        generateRowData(rowDetails);

        DataExporterCallback callback = rowDetails.getTable().getCallback();
        if (callback != null) {
            callback.beforeRow(rowDetails);
        }
       
        beforeRow(rowDetails);
       
        for (int columnIndex = 0; columnIndex < rowDetails.getTable().getColumns().size(); columnIndex++) {
            CellDetails cellDetails = new CellDetails(rowDetails, columnIndex);
            cellDetails.setCellValue(rowDetails.getRow().getCellValue(cellDetails));
            cellDetails.setCellValue(rowDetails.getRow().getCellValue(cellDetails));
           
            if (callback != null) {
                callback.beforeCell(cellDetails);
            }
           
            beforeRowCell(cellDetails);
            writeRowCell(cellDetails);
            afterRowCell(cellDetails);

            if (callback != null) {
                callback.afterCell(cellDetails);
            }
        }
       
        afterRow(rowDetails);

        if (callback != null) {
            callback.afterRow(rowDetails);
        }
    }
View Full Code Here

TOP

Related Classes of com.brsanthu.dataexporter.model.DataExporterCallback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.