List of usage examples for com.lowagie.text Table addCell
public void addCell(String content) throws BadElementException
Cell
to the Table
. From source file:org.drools.verifier.doc.DroolsDocsComponentFactory.java
License:Apache License
public static Table newDescription(String description) throws DocumentException { if (description == null || "".equals(description)) { description = " - "; }/*ww w . ja va 2s . c om*/ Table table = newTable(); Cell headerCell = newHeaderCell("Description", CATEGORIES_TEXT); table.addCell(headerCell); table.addCell(newCell(description)); return table; }
From source file:org.drools.verifier.doc.DroolsDocsComponentFactory.java
License:Apache License
public static Table newRuleTable(DrlRuleParser drl) throws BadElementException, DocumentException { Table table = newTable(); Cell headerCell = newHeaderCell("Attributes", CATEGORIES_TEXT); table.addCell(headerCell); for (String s : drl.getHeader()) { table.addCell(newCell(INDENT + s.trim())); }/* w ww . j a v a 2 s . co m*/ table.addCell(newHeaderCell(INDENT + "WHEN", BODY_TEXT)); for (String s : drl.getLhs()) { table.addCell(newCell(INDENT + INDENT + s.trim())); } table.addCell(newHeaderCell(INDENT + "THEN", BODY_TEXT)); for (String s : drl.getRhs()) { table.addCell(newCell(INDENT + INDENT + s.trim())); } // table.addCell( newEmptyWhenThenCell( "END" ) ); return table; }
From source file:org.drools.verifier.doc.DroolsDocsComponentFactory.java
License:Apache License
public static Table newTable(final String topic, Collection<String> items) throws BadElementException, DocumentException { Table table = newTable(); Cell headerCell = newHeaderCell(topic, CATEGORIES_TEXT); table.addCell(headerCell); if (items.isEmpty()) { table.addCell(newCell(" - ")); } else {// w w w . j a v a2s.c o m for (String s : items) { table.addCell(newCell(s)); } } return table; }
From source file:org.eclipse.osee.ats.rest.internal.build.report.table.BuildTraceTable.java
License:Open Source License
private void addbuildTraceCells(Table buildTraceTable, String element) throws OseeCoreException { String url = String.format(changeReportUrlTemplate, element); try {/*from w w w . jav a2 s. c om*/ buildTraceTable.addCell(setHyperlink(element.toString(), url)); } catch (BadElementException ex) { OseeExceptions.wrapAndThrow(ex); } }
From source file:org.eclipse.osee.ats.rest.internal.build.report.table.BuildTraceTable.java
License:Open Source License
private void addRequirementTraceCells(Table nestedRequirementTable, String element) throws OseeCoreException { try {//from ww w . j a v a2 s . com nestedRequirementTable.addCell(element); } catch (BadElementException ex) { OseeExceptions.wrapAndThrow(ex); } }
From source file:org.eclipse.osee.ats.rest.internal.build.report.table.BuildTraceTable.java
License:Open Source License
private void addNewTestScriptTraceCells(Table nestedTestScriptTable, Iterable<ArtifactReadable> testScripts) throws OseeCoreException { if (testScripts != null) { // If test script has a name store in sorted set SortedSet<String> sortedList = new TreeSet<String>(); for (ArtifactReadable script : testScripts) { if (!script.getName().isEmpty()) { sortedList.add(script.getName()); }/*from w ww.j av a 2s . c om*/ } // Create test script Table Iterator<String> treeItr = sortedList.iterator(); while (treeItr.hasNext()) { try { String verifierName = treeItr.next(); nestedTestScriptTable.addCell(verifierName); for (Pair<String, String> nameToUri : uriProvider.getBuildToUrlPairs(verifierName)) { Anchor toAdd = setHyperlink(nameToUri.getFirst(), nameToUri.getSecond()); nestedTestScriptTable.addCell(toAdd); } } catch (BadElementException ex) { OseeExceptions.wrapAndThrow(ex); } } } }
From source file:org.eclipse.osee.framework.ui.skynet.util.TableWriterAdaptor.java
License:Open Source License
public void writeHeader(Table table, String[] headers) throws Exception { for (String header : headers) { Cell cell = new Cell(); cell.setHeader(true);//from w w w . jav a 2 s . c o m cell.setColspan(1); cell.setBackgroundColor(WebColors.getRGBColor("#d9d9d9")); cell.setHorizontalAlignment(ElementTags.ALIGN_CENTER); Font font = FontFactory.getFont("Times New Roman", BaseFont.CP1252, BaseFont.EMBEDDED, 9, Font.BOLD, WebColors.getRGBColor("#000000")); Paragraph paragraph = new Paragraph(header, font); paragraph.setAlignment(ElementTags.ALIGN_CENTER); cell.add(paragraph); table.addCell(cell); } }
From source file:org.eclipse.osee.framework.ui.skynet.util.TableWriterAdaptor.java
License:Open Source License
public void writeRow(Table table, String... cellData) { for (String cellText : cellData) { Cell cell = new Cell(); cell.setHeader(false);/* www . java 2 s . co m*/ cell.setColspan(1); Font font = FontFactory.getFont("Times New Roman", BaseFont.CP1252, BaseFont.EMBEDDED, 9, Font.NORMAL, WebColors.getRGBColor("#000000")); Paragraph paragraph = new Paragraph(cellText, font); cell.add(paragraph); table.addCell(cell); } }
From source file:org.goobi.production.flow.helper.SearchResultHelper.java
License:Open Source License
public void getResultAsRtf(List<SearchColumn> columnList, String filter, String order, boolean showClosedProcesses, boolean showArchivedProjects, OutputStream out) { Document document = new Document(); RtfWriter2.getInstance(document, out); @SuppressWarnings("rawtypes") List list = search(columnList, filter, order, showClosedProcesses, showArchivedProjects); document.open();/*from w ww. ja v a2 s .c o m*/ Table table = null; try { table = new Table(columnList.size()); } catch (BadElementException e1) { } table.setBorderWidth(1); for (SearchColumn sc : columnList) { Cell cell = new Cell(Helper.getTranslation(sc.getValue())); cell.setHeader(true); table.addCell(cell); } table.endHeaders(); for (Object obj : list) { Object[] objArr = (Object[]) obj; for (Object entry : objArr) { Cell cell = new Cell((String) entry); table.addCell(cell); } } try { document.add(table); } catch (DocumentException e) { } document.close(); return; }
From source file:org.inbio.modeling.core.manager.impl.ExportManagerImpl.java
License:Open Source License
@Override public Document exportPDF(Document document, Double resolution, String imageName, String limitLayerName, List<GrassLayerDTO> layerList, long currentSessionId, Locale locale) throws Exception { // set the current locale globally this.currentLocale = locale; // Add metadata this.addMetadata(document); // Modeling threats report (Main title) this.addTitleOne(document, this.getI18nString("pdfReport.threatModel")); // Generated escenary (Sub title) this.addTitleTwo(document, this.getI18nString("pdfReport.proposedScenary"), true); this.addNewLine(document, 20); // Map and scale image this.addImageSection(document, imageName, currentSessionId); // General information of the scenario this.addTitleTwo(document, this.getI18nString("pdfReport.generalInfo")); // resolution information document.add(new Paragraph(this.getI18nString("pdfReport.resolution") + ": " + resolution + " " + this.getI18nString("pdfReport.meters"))); this.addNewLine(document, 1); // Limit layer document.add(new Paragraph(this.getI18nString("pdfReport.limitLayer") + " : " + limitLayerName)); this.addNewLine(document, 1); document.newPage();//from ww w. ja v a 2 s. co m // Layer sub-section this.addTitleTwo(document, this.getI18nString("pdfReport.layers")); Table table; LayerDTO layer = null; List<CategoryDTO> categorys; for (GrassLayerDTO grassLayerDTO : layerList) { // layer name (title) this.addTitleThree(document, grassLayerDTO.getDisplayName()); // Get the layer information layer = layerManager.getLayerByName(grassLayerDTO.getName()); // create the table with the metadata information. table = this.create2columnTable(); this.addTableHeader(table, this.getI18nString("pdfReport.metadata")); this.addTableRow(table, this.getI18nString("pdfReport.source"), layer.getSource()); this.addTableRow(table, this.getI18nString("pdfReport.year"), layer.getYear()); this.addTableRow(table, this.getI18nString("pdfReport.visualizationScale"), layer.getVizScale()); this.addTableRow(table, this.getI18nString("pdfReport.dataScale"), layer.getDataScale()); this.addTableRow(table, this.getI18nString("pdfReport.generationProcedure"), layer.getGenerationProcedure()); this.addTableRow(table, this.getI18nString("pdfReport.description"), layer.getDescription()); this.addTableRow(table, this.getI18nString("pdfReport.dataType"), grassLayerDTO.getType().toString()); document.add(table); // Create the table with the infomation about the reclasification or parameters used // in the scenario generation process. table = this.create2columnTable(); this.addTableHeader(table, this.getI18nString("pdfReport.layerDataConf")); // Print the intervals/category/Radio information categorys = grassLayerDTO.getCategories(); if (grassLayerDTO.getType().equals(LayerType.AREA)) { for (CategoryDTO categoryDTO : categorys) { if (categoryDTO != null) { table.addCell(categoryDTO.getValue()); table.addCell(categoryDTO.getDescription()); } } } else if (grassLayerDTO.getType().equals(LayerType.LINE)) { String minimal = "0"; int counter = 2; table.addCell("1"); table.addCell(this.getI18nString("pdfReport.lineMarker")); for (CategoryDTO categoryDTO : categorys) { table.addCell(counter++ + " "); table.addCell( minimal + " - " + categoryDTO.getValue() + this.getI18nString("pdfReport.meters")); minimal = categoryDTO.getValue(); } } else { table.addCell(this.getI18nString("pdfReport.radio")); table.addCell(categorys.get(0).getValue() + this.getI18nString("pdfReport.meters")); } document.add(table); } String footerText[] = { this.getI18nString("pdfReport.footer1"), this.getI18nString("pdfReport.footer2"), this.getI18nString("pdfReport.footer3") }; this.addDocumentFooter(document, footerText); return document; }