Class FIXGRIDPDFExporter
java.lang.Object
org.eclnt.jsfserver.elements.util.FIXGRIDPDFExporter
- All Implemented Interfaces:
Serializable
,IFIXGRIDPdfExporter
Export of grid content into PDF. The grid's exporter creates an instance
of this class and calls it via the
exportGridToPdf(FIXGRIDBinding, List, List, boolean)
method.- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterGrid
(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) Method for adding information to be printed behind the grid.protected void
afterTitle
(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) Method for adding information to be printed behind the grid.protected void
applyBackgroundColorStrToCell
(String colorString, com.lowagie.text.pdf.PdfPCell cell, Color nullColor) protected void
applyFontStrToParagraph
(com.lowagie.text.Paragraph p, String fontStr) protected void
applyRowHeightToCell
(Float rowHeight, com.lowagie.text.pdf.PdfPCell cell) protected void
applyTextColorStrToParagraph
(String textColorString, com.lowagie.text.Paragraph p) protected void
beforeGrid
(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) Method for adding information to be printed in front of the grid.protected void
beforeTitle
(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) Method for adding information to be printed in front of the title.protected void
buildRow
(List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, com.lowagie.text.pdf.PdfPTable table, int dataRowIndex, List<String> dataRow, Color rowToggleColor) protected int
calculateColumnWidth
(org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo ci) Calculation of column width.protected com.lowagie.text.Document
createDocument
(FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns) Creation of iText document object.protected com.lowagie.text.Paragraph
createParagraph
(String text, com.lowagie.text.Font font, com.lowagie.text.pdf.FontSelector fontSelector) byte[]
exportGridToPdf
(FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data, boolean selctedItemsOnly) Main method for exporting.protected String
findAlignmentForDataCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findAlignmentForFooterCell
(int footerRowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findAlignmentForHeaderCell
(int headerRowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findBackgroundColorForDataCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findBackgroundColorForFooterCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findBackgroundColorForHeaderCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected Float
findExplicitFooterRowHeight
(int rowIndex) protected Float
findExplicitHeaderRowHeight
(int rowIndex) protected Float
findExplicitRowHeight
(int dataRowIndex) protected String
findFontForDataCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findFontForFooterCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findFontForHeaderCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findTextColorForDataCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findTextColorForFooterCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.protected String
findTextColorForHeaderCell
(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation.float
void
initPageSize
(float width, float height) Explicit definition of page size.protected String
protected void
printTitle
(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) void
setColorDarkRow
(Color value) void
setColorFooterline
(Color value) void
setColorHeadline
(Color value) void
setColorLightRow
(Color value) void
setColumnSizeFactor
(float columnSizeFactor) There is a calculation of column widths which is based in the width definition inside the FIXGRID component.void
setExportInfoProvider
(IFIXGRIDExportInfoProvider exportInfoProvider) Optional call back interface which allows the exporter to get more information about individual data rows/cells.void
setFontDataline
(com.lowagie.text.Font value) void
setFontFooterline
(com.lowagie.text.Font value) void
setFontHeadline
(com.lowagie.text.Font value) void
setFontselectorDataline
(com.lowagie.text.pdf.FontSelector value) void
setFontselectorFooterline
(com.lowagie.text.pdf.FontSelector value) void
setFontselectorHeadline
(com.lowagie.text.pdf.FontSelector value) void
setFontselectorTitle
(com.lowagie.text.pdf.FontSelector value) void
setFontTitle
(com.lowagie.text.Font value) void
setGridTitle
(String title) Setting of title text that is printed before the grid.
-
Field Details
-
FONT_TITLE
public static com.lowagie.text.Font FONT_TITLE -
FONT_HEADLINE
public static com.lowagie.text.Font FONT_HEADLINE -
FONT_FOOTERLINE
public static com.lowagie.text.Font FONT_FOOTERLINE -
FONT_DATALINE
public static com.lowagie.text.Font FONT_DATALINE -
COLOR_HEADLINE
-
COLOR_FOOTERLINE
-
COLOR_LIGHTROW
-
COLOR_DARKROW
-
-
Constructor Details
-
FIXGRIDPDFExporter
public FIXGRIDPDFExporter()
-
-
Method Details
-
initPageSize
public void initPageSize(float width, float height) Description copied from interface:IFIXGRIDPdfExporter
Explicit definition of page size. If not called then DIN A4 will be used as page size.- Specified by:
initPageSize
in interfaceIFIXGRIDPdfExporter
-
setFontTitle
public void setFontTitle(com.lowagie.text.Font value) - Specified by:
setFontTitle
in interfaceIFIXGRIDPdfExporter
-
setFontHeadline
public void setFontHeadline(com.lowagie.text.Font value) - Specified by:
setFontHeadline
in interfaceIFIXGRIDPdfExporter
-
setFontDataline
public void setFontDataline(com.lowagie.text.Font value) - Specified by:
setFontDataline
in interfaceIFIXGRIDPdfExporter
-
setColorHeadline
-
setColorLightRow
-
setColorDarkRow
-
setFontselectorTitle
public void setFontselectorTitle(com.lowagie.text.pdf.FontSelector value) - Specified by:
setFontselectorTitle
in interfaceIFIXGRIDPdfExporter
-
setFontselectorHeadline
public void setFontselectorHeadline(com.lowagie.text.pdf.FontSelector value) - Specified by:
setFontselectorHeadline
in interfaceIFIXGRIDPdfExporter
-
setFontselectorDataline
public void setFontselectorDataline(com.lowagie.text.pdf.FontSelector value) - Specified by:
setFontselectorDataline
in interfaceIFIXGRIDPdfExporter
-
setGridTitle
Description copied from interface:IFIXGRIDPdfExporter
Setting of title text that is printed before the grid.- Specified by:
setGridTitle
in interfaceIFIXGRIDPdfExporter
-
getGridTitle
-
setColumnSizeFactor
public void setColumnSizeFactor(float columnSizeFactor) There is a calculation of column widths which is based in the width definition inside the FIXGRID component. You can influence this calculation by assigning a factor. The calculated width is multiplied with the factor after calculation. The default value of the factor is 1f representing "100%".- Specified by:
setColumnSizeFactor
in interfaceIFIXGRIDPdfExporter
-
getColumnSizeFactor
public float getColumnSizeFactor()- Specified by:
getColumnSizeFactor
in interfaceIFIXGRIDPdfExporter
-
setExportInfoProvider
Description copied from interface:IFIXGRIDPdfExporter
Optional call back interface which allows the exporter to get more information about individual data rows/cells.- Specified by:
setExportInfoProvider
in interfaceIFIXGRIDPdfExporter
-
exportGridToPdf
public byte[] exportGridToPdf(FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data, boolean selctedItemsOnly) Main method for exporting.- Specified by:
exportGridToPdf
in interfaceIFIXGRIDPdfExporter
-
applyBackgroundColorStrToCell
-
applyRowHeightToCell
-
applyFontStrToParagraph
-
buildRow
-
applyTextColorStrToParagraph
-
findExplicitRowHeight
-
findExplicitHeaderRowHeight
-
findBackgroundColorForDataCell
protected String findBackgroundColorForDataCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findBackgroundColorForHeaderCell
protected String findBackgroundColorForHeaderCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findAlignmentForDataCell
protected String findAlignmentForDataCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findAlignmentForHeaderCell
protected String findAlignmentForHeaderCell(int headerRowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findTextColorForDataCell
protected String findTextColorForDataCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findTextColorForHeaderCell
protected String findTextColorForHeaderCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findFontForDataCell
protected String findFontForDataCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
findFontForHeaderCell
protected String findFontForHeaderCell(int rowIndex, String dataCellValue, org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo column) Cell processing: Explicit possibility to override by an own implementation. -
createDocument
protected com.lowagie.text.Document createDocument(FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns) Creation of iText document object. Calculation of size of page according to column widths. -
beforeTitle
protected void beforeTitle(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) Method for adding information to be printed in front of the title. -
printTitle
protected void printTitle(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) -
afterTitle
protected void afterTitle(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) Method for adding information to be printed behind the grid. -
beforeGrid
protected void beforeGrid(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) Method for adding information to be printed in front of the grid. -
afterGrid
protected void afterGrid(com.lowagie.text.Document document, FIXGRIDBinding fixgrid, List<org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo> columns, List<List<String>> data) Method for adding information to be printed behind the grid. -
calculateColumnWidth
protected int calculateColumnWidth(org.eclnt.jsfserver.elements.impl.FIXGRIDComponent.ColumnInfo ci) Calculation of column width. -
objectToString
-
createParagraph
protected com.lowagie.text.Paragraph createParagraph(String text, com.lowagie.text.Font font, com.lowagie.text.pdf.FontSelector fontSelector)
-