Package com.sun.faban.common

Examples of com.sun.faban.common.TableModel


        if (tableAttachments != null) {
            Set<Map.Entry<String, CustomTableMetrics>> entries =
                    tableAttachments.entrySet();
            for (Map.Entry<String, CustomTableMetrics> entry : entries) {
                CustomTableMetrics attachment = entry.getValue();
                TableModel table = null;
                try {
                    table = attachment.getResults();
                } catch (Exception e) { // Ensure the getResults
                    // doesn't break report generation.
                    logger.log(Level.WARNING,
                            "Exceptions reporting CustomTableMetrics", e);
                }
                int rows = table.rows();
                if (table != null && rows > 0) {
                    space(8, buffer).append("<customTable name=\"").
                            append(entry.getKey()).append("\">\n");
                    space(12, buffer).append("<head>\n");
                    for (int i = 0; i < table.columns(); i++) {
                    space(16, buffer).append("<th>").append(table.getHeader(i)).
                            append("</th>\n");
                    }
                    space(12, buffer).append("</head>\n");

                    for(int i = 0; i < rows; i++) {
                        Comparable[] row = table.getRow(i);
                        space(12, buffer).append("<tr>\n");
                        for (int j = 0; j < row.length; j++) {
                            space(16, buffer).append("<td>").append(row[j]).
                                    append("</td>\n");
                        }
View Full Code Here

TOP

Related Classes of com.sun.faban.common.TableModel

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.