List of usage examples for com.lowagie.text Cell setHeader
public void setHeader(boolean value)
From source file:org.displaytag.export.PdfView.java
License:Artistic License
/** * Generates the header cells, which persist on every page of the PDF document. * @throws BadElementException IText exception *//* ww w . j ava 2 s .c o m*/ protected void generateHeaders() throws BadElementException { Iterator<HeaderCell> iterator = this.model.getHeaderCellList().iterator(); while (iterator.hasNext()) { HeaderCell headerCell = iterator.next(); String columnHeader = headerCell.getTitle(); if (columnHeader == null) { columnHeader = StringUtils.capitalize(headerCell.getBeanPropertyName()); } Cell hdrCell = getCell(columnHeader); hdrCell.setGrayFill(0.9f); hdrCell.setHeader(true); tablePDF.addCell(hdrCell); } }
From source file:org.displaytag.render.ItextTableWriter.java
License:Artistic License
/** * Obtain a header cell.//from www.j a v a 2s. co m * @param value Cell content. * @return A header cell with the given content. * @throws BadElementException if errors occurs while generating content. */ private Cell getHeaderCell(String value) throws BadElementException { Chunk cellContent = new Chunk(value, this.getHeaderFont()); setHeaderFontStyle(cellContent); Cell cell = new Cell(cellContent); cell.setLeading(8); cell.setHeader(true); cell.setHorizontalAlignment(this.getHeaderHorizontalAlignment()); cell.setBackgroundColor(this.getHeaderBackgroundColor()); return cell; }
From source file:org.eclipse.osee.ats.rest.internal.build.report.table.BuildTraceTable.java
License:Open Source License
public void initializeTraceReportTable(String program, String build) throws OseeCoreException { String header = String.format("%s: [%s - %s]", AtsElementData.BUILD_TRACE_REPORT, program, build); document = new Document(); document.addTitle(header);// w w w.j av a 2s . c om HtmlWriter.getInstance(document, output); document.open(); createTables(); Cell headerCell = new RtfCell(header); headerCell.setColspan(1); headerCell.setHeader(true); headerCell.setHorizontalAlignment(Element.ALIGN_CENTER); reportTable.addCell(headerCell); reportTable.endHeaders(); reportTable.setTableFitsPage(true); Cell rpcrCell = new RtfCell(AtsElementData.RPCR); rpcrCell.setHeader(true); rpcrCell.setHorizontalAlignment(Element.ALIGN_CENTER); traceReportTable.addCell(rpcrCell); Cell req = new Cell(AtsElementData.REQUIREMENT); req.setHeader(true); req.setHorizontalAlignment(Element.ALIGN_CENTER); nestedHeaderTable.addCell(req); Cell script = new Cell(AtsElementData.TEST_SCRIPT); script.setHeader(true); script.setHorizontalAlignment(Element.ALIGN_CENTER); nestedHeaderTable.addCell(script); traceReportTable.insertTable(nestedHeaderTable); sortedRpcr = new TreeSet<Pair<String, Table>>(PairCompare); }
From source file:org.eclipse.osee.ats.rest.internal.build.report.table.UrlListTable.java
License:Open Source License
public void initializeTable(String title, String lastRun, String... headers) throws OseeCoreException { document = new Document(); lastRunDate = lastRun;/* w ww .j av a 2 s.c om*/ sortedList = new TreeSet<List<Anchor>>(new Comparator<List<Anchor>>() { @Override public int compare(List<Anchor> anchor1, List<Anchor> anchor2) { String name1 = anchor1.get(0).toString(); String name2 = anchor2.get(0).toString(); return name1.compareTo(name2); } }); HtmlWriter.getInstance(document, output); document.addTitle(title); document.open(); try { table = new Table(headers.length); } catch (BadElementException ex) { OseeExceptions.wrapAndThrow(ex); } for (String header : headers) { Cell headerCell = new Cell(header); headerCell.setHeader(true); headerCell.setHorizontalAlignment(Element.ALIGN_CENTER); table.addCell(headerCell); } table.setWidth(10f * headers.length); table.setAlignment(Element.ALIGN_BOTTOM); }
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); cell.setColspan(1);//from w w w . j a v a 2 s . c o m 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); cell.setColspan(1);/* w w w. j ava2 s .co m*/ 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.egov.infra.web.displaytag.export.EGovPdfView.java
License:Open Source License
/** * Generates the header cells, which persist on every page of the PDF document. * @throws BadElementException IText exception */// w w w.j a va 2 s . com protected void generateHeaders() throws BadElementException { final Iterator iterator = this.model.getHeaderCellList().iterator(); while (iterator.hasNext()) { final HeaderCell headerCell = (HeaderCell) iterator.next(); String columnHeader = headerCell.getTitle(); if (columnHeader == null) { columnHeader = StringUtils.capitalize(headerCell.getBeanPropertyName()); } final Cell hdrCell = getCell(columnHeader); hdrCell.setGrayFill(0.9f); hdrCell.setHeader(true); this.tablePDF.addCell(hdrCell); } }
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 w w . j av a 2s . com*/ 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
private void addTableRow(Table t, String title, String value) throws BadElementException { // Fonts Definition Font boldFont = new Font(Font.TIMES_ROMAN, 12, Font.BOLD); Cell cell = new Cell(new Chunk(title, boldFont)); cell.setHeader(true); t.addCell(cell);/*w w w . j a v a 2s. c o m*/ t.addCell(value); }
From source file:org.inbio.modeling.core.manager.impl.ExportManagerImpl.java
License:Open Source License
private void addTableHeader(Table t, String text) throws BadElementException { Chunk chunk = new Chunk(text, new Font(Font.TIMES_ROMAN, 15, Font.BOLD)); Cell cell = new Cell(chunk); cell.setHorizontalAlignment(Cell.ALIGN_CENTER); cell.setHeader(true); cell.setColspan(2);// w w w .j a v a2 s. c om t.addCell(cell); }