Example usage for com.lowagie.text Table insertTable

List of usage examples for com.lowagie.text Table insertTable

Introduction

In this page you can find the example usage for com.lowagie.text Table insertTable.

Prototype

public void insertTable(Table aTable) 

Source Link

Document

To put a table within the existing table at the current position generateTable will of course re-arrange the widths of the columns.

Usage

From source file:org.eclipse.osee.ats.rest.internal.build.report.table.BuildTraceTable.java

License:Open Source License

public void addRpcrToTable(String rpcr, Map<ArtifactReadable, Iterable<ArtifactReadable>> requirementsToTests)
        throws OseeCoreException {
    try {//from w  w  w.j a v a 2 s  . c o  m
        Table nestedRequirementTable = new Table(2);
        //         nestedRequirementTable.setAutoFillEmptyCells(true);
        SortedSet<Pair<String, Table>> nestedRpcr = new TreeSet<Pair<String, Table>>(PairCompare);

        for (Entry<ArtifactReadable, Iterable<ArtifactReadable>> entry : requirementsToTests.entrySet()) {
            ArtifactReadable changedReq = entry.getKey();
            if (Conditions.notNull(changedReq)) {
                Table nestedTestScriptTable = new Table(1 + uriProvider.getColumnCount());
                nestedTestScriptTable.setAutoFillEmptyCells(true);
                addNewTestScriptTraceCells(nestedTestScriptTable, entry.getValue());
                // Store Requirement string and TestScriptTable for sorting
                Pair<String, Table> newPair = new Pair<String, Table>(changedReq.getName(),
                        nestedTestScriptTable);
                nestedRpcr.add(newPair);
            }
        }
        // Create sorted requirement Table
        Iterator<Pair<String, Table>> treeItr = nestedRpcr.iterator();
        while (treeItr.hasNext()) {
            Pair<String, Table> pair = treeItr.next();
            addRequirementTraceCells(nestedRequirementTable, pair.getFirst());
            nestedRequirementTable.insertTable(pair.getSecond());
        }
        // Save RPCR ID with sorted requirement string Table.
        Pair<String, Table> newPair = new Pair<String, Table>(rpcr, nestedRequirementTable);
        sortedRpcr.add(newPair);
    } catch (BadElementException ex) {
        OseeExceptions.wrapAndThrow(ex);
    }

}