table = new PdfPTable(3); table.setWidths(new int[]{1, 1, 1}); table.addCell(buildPdfPCell(hf,left,1)); table.addCell(buildPdfPCell(hf,center,2)); table.addCell(buildPdfPCell(hf,right,3)); }else if(StringUtils.isNotEmpty(center)){ table = new PdfPTable(3); table.setWidths(new int[]{1, 1, 1}); table.addCell(buildPdfPCell(hf,left,1)); table.addCell(buildPdfPCell(hf,center,2)); table.addCell(buildPdfPCell(hf,"",3)); }else if(StringUtils.isNotEmpty(right)){ table = new PdfPTable(3); table.setWidths(new int[]{1, 1, 1}); table.addCell(buildPdfPCell(hf,left,1)); table.addCell(buildPdfPCell(hf,"",2)); table.addCell(buildPdfPCell(hf,right,3)); }else{ table = new PdfPTable(1); table.setWidths(new int[]{1}); table.addCell(buildPdfPCell(hf,left,1)); table = new PdfPTable(3); table.setWidths(new int[]{1, 1, 1}); table.addCell(buildPdfPCell(hf,"",1)); table.addCell(buildPdfPCell(hf,center,2)); table.addCell(buildPdfPCell(hf,right,3)); }else{ table = new PdfPTable(1);
/** * Completes the current row with the default cell. An incomplete row will * be dropped but calling this method will make sure that it will be present * in the table. */ public void completeRow() { while (!rowCompleted) { addCell(defaultCell); } }
@Override public void addCell( Image image ) { this.empty = false; super.addCell( image ); }
@Override public void addCell( PdfPTable table ) { this.empty = false; super.addCell( table ); }
@Override public void addCell( Phrase phrase ) { this.empty = false; super.addCell( phrase ); }
@Override public void addCell( String text ) { this.empty = false; super.addCell( text ); }
/** * Completes the current row with the default cell. An incomplete row will * be dropped but calling this method will make sure that it will be present * in the table. */ public void completeRow() { while (!rowCompleted) { addCell(defaultCell); } }
PdfPCell pdfMarginCell=new PdfPCell(); pdfMarginCell.setBorder(Rectangle.NO_BORDER); table.addCell(pdfMarginCell); childTable.addCell(pdfcell); PdfPCell lastCell=new PdfPCell(); lastCell.setBorder(Rectangle.NO_BORDER); childTable.addCell(lastCell); table.addCell(pdfContainerCell); PdfPCell pdfMarginCell=new PdfPCell(); pdfMarginCell.setBorder(Rectangle.NO_BORDER); table.addCell(pdfMarginCell); pdfMarginCell=new PdfPCell(); pdfMarginCell.setBorder(Rectangle.NO_BORDER); table.addCell(pdfMarginCell); table.addCell(pdfcell);
/** * Adds a cell element. * * @param text the text for the cell */ public void addCell(final String text) { addCell(new Phrase(text)); }
/** * Adds a cell element. * * @param text the text for the cell */ public void addCell(final String text) { addCell(new Phrase(text)); }
private void addTotalRow(final TestRunCoverageStatistics runStats, final PdfPTable table) { table.addCell(createCell("Total", FONT_TOTAL, 0)); table.addCell(createCell(String.valueOf(runStats.getTotalStatements()), FONT_TOTAL, 1)); table.addCell(createCell(String.valueOf(runStats.getTotalExecuted()), FONT_TOTAL, 2)); table.addCell(createCell(runStats.getTotalCoverage() + "%", FONT_TOTAL, 3)); }
/** * Adds a nested table. * * @param table the table to be added to the cell */ public void addCell(final PdfPTable table) { defaultCell.setTable(table); PdfPCell newCell = addCell(defaultCell); newCell.id = new AccessibleElementId(); defaultCell.setTable(null); }
/** * Adds a cell element. * * @param phrase the <CODE>Phrase</CODE> to be added to the cell */ public void addCell(final Phrase phrase) { defaultCell.setPhrase(phrase); PdfPCell newCell = addCell(defaultCell); newCell.id = new AccessibleElementId(); defaultCell.setPhrase(null); }
/** * Adds an Image as Cell. * * @param image the <CODE>Image</CODE> to add to the table. This image will * fit in the cell */ public void addCell(final Image image) { defaultCell.setImage(image); PdfPCell newCell = addCell(defaultCell); newCell.id = new AccessibleElementId(); defaultCell.setImage(null); }
private void emitHeaders(PdfPTable table, CellStyler styler) { Phrase tagHeader = new Phrase("Tag", styler.cellFont()); Phrase descHeader = new Phrase("Description", styler.cellFont()); table.addCell(styler.applyStyle(new PdfPCell(tagHeader))); table.addCell(styler.applyStyle(new PdfPCell(descHeader))); table.setHeaderRows(1); } }
private void title(PdfPTable pdf) { PdfPCell cell = new PdfPCell(new Phrase(table.getTitle(), smallBold)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(table.getHeaders().size()); pdf.addCell(cell); }
private PdfPCell createStringCell(PdfPTable table, String text, ExcelExportEntity entity, int rowHeight) { PdfPCell iCell = new PdfPCell(new Phrase(text, styler.getFont(entity, text))); styler.setCellStyler(iCell, entity, text); iCell.setFixedHeight((int) (rowHeight * 2.5)); table.addCell(iCell); return iCell; }
private PdfPCell createStringCell(PdfPTable table, String text, ExcelExportEntity entity, int rowHeight) { PdfPCell iCell = new PdfPCell(new Phrase(text, styler.getFont(entity, text))); styler.setCellStyler(iCell, entity, text); iCell.setFixedHeight((int) (rowHeight * 2.5)); table.addCell(iCell); return iCell; }
private void emitStepInErrorLegend(ITextContext emitterContext) { Styles styles = emitterContext.styles(); PdfPTable table = new PdfPTable(new float[]{1f, 24f}); table.addCell(noBorder(topRight(new PdfPCell(stepInErrorMarker(styles))))); table.addCell(noBorder(new PdfPCell(new Phrase(": First step in error within the scenario", new FontCopier(styles.defaultFont()).italic().get())))); table.setSpacingBefore(10f); table.setSpacingAfter(10f); emitterContext.append(table); }
private PdfPTable createTable( PdfPCell cell ) { PdfPTable table = new PdfPTable( 1 ); table.setSpacingBefore( this.spacingBefore() ); table.setSpacingAfter( this.spacingAfter() ); table.setHorizontalAlignment( this.getHorizontalAlignment() ); table.setTotalWidth( cell.getPaddingLeft() + this.getTotalWidth() + cell.getPaddingRight() ); table.setLockedWidth( true ); table.setSplitLate( false ); table.addCell( cell ); return table; }