Package org.primefaces.component.export
Class TableExporter<T extends javax.faces.component.UIComponent & UITable,D,O extends ExporterOptions>
java.lang.Object
org.primefaces.component.export.TableExporter<T,D,O>
- All Implemented Interfaces:
Exporter<T>
- Direct Known Subclasses:
DataTableExporter,TreeTableExporter
public abstract class TableExporter<T extends javax.faces.component.UIComponent & UITable,D,O extends ExporterOptions>
extends Object
implements Exporter<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumprotected static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Set<TableExporter.FacetType>protected final booleanprotected Dprotected ExportConfiguration -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTableExporter(O defaultOptions) protectedTableExporter(O defaultOptions, Set<TableExporter.FacetType> supportedFacetTypes, boolean cellJoinComponents) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidaddColumnFacets(javax.faces.context.FacesContext context, T table, TableExporter.ColumnType columnType) protected booleanaddColumnGroupFacets(javax.faces.context.FacesContext context, T table, TableExporter.ColumnType columnType) protected voidaddTableFacets(javax.faces.context.FacesContext context, T table, TableExporter.ColumnType columnType) protected abstract DcreateDocument(javax.faces.context.FacesContext context) voidexport(javax.faces.context.FacesContext context, List<T> tables, ExportConfiguration exportConfiguration) protected abstract voidprotected abstract voidexportCellValue(javax.faces.context.FacesContext context, T table, UIColumn col, ColumnValue columnValue, int index) protected voidexportColumnFacetValue(javax.faces.context.FacesContext context, T table, ColumnValue columnValue, int index) protected voidexportColumnGroupFacetValue(javax.faces.context.FacesContext context, T table, UIColumn column, AtomicInteger colIndex, ColumnValue columnValue) protected abstract voidexportPageOnly(javax.faces.context.FacesContext context, T table) protected abstract voidexportSelectionOnly(javax.faces.context.FacesContext context, T table) protected voidexportTable(javax.faces.context.FacesContext context, T table, int index) protected voidexportTabletFacetValue(javax.faces.context.FacesContext context, T table, String textValue) getColumnExportTag(javax.faces.context.FacesContext context, UIColumn column) getColumnFacetValue(javax.faces.context.FacesContext context, UIColumn column, TableExporter.ColumnType columnType) getColumnValue(javax.faces.context.FacesContext context, UITable table, UIColumn column, boolean joinComponents) getComponentFacetValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent, String facetname) getComponentValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) getExportableColumns(T table) Gets and caches the list of UIColumns that are exportable="true", visible="true", and rendered="true".protected Object[]protected Ooptions()protected OutputStreamos()protected voidpostExport(javax.faces.context.FacesContext context) protected voidpostRowExport(javax.faces.context.FacesContext context, T table) protected voidpreExport(javax.faces.context.FacesContext context) protected voidpreRowExport(javax.faces.context.FacesContext context, T table) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.primefaces.component.export.Exporter
getContentType, getFileExtension
-
Field Details
-
ALL_FACETS
-
document
-
exportConfiguration
-
cellJoinComponents
protected final boolean cellJoinComponents
-
-
Constructor Details
-
TableExporter
-
TableExporter
protected TableExporter(O defaultOptions, Set<TableExporter.FacetType> supportedFacetTypes, boolean cellJoinComponents)
-
-
Method Details
-
export
public void export(javax.faces.context.FacesContext context, List<T> tables, ExportConfiguration exportConfiguration) throws IOException - Specified by:
exportin interfaceExporter<T extends javax.faces.component.UIComponent & UITable>- Throws:
IOException
-
exportTable
protected void exportTable(javax.faces.context.FacesContext context, T table, int index) throws IOException - Throws:
IOException
-
addTableFacets
protected void addTableFacets(javax.faces.context.FacesContext context, T table, TableExporter.ColumnType columnType) -
addColumnFacets
protected void addColumnFacets(javax.faces.context.FacesContext context, T table, TableExporter.ColumnType columnType) throws IOException - Throws:
IOException
-
addColumnGroupFacets
protected boolean addColumnGroupFacets(javax.faces.context.FacesContext context, T table, TableExporter.ColumnType columnType) -
addCells
-
exportTabletFacetValue
-
exportColumnFacetValue
protected void exportColumnFacetValue(javax.faces.context.FacesContext context, T table, ColumnValue columnValue, int index) -
exportColumnGroupFacetValue
protected void exportColumnGroupFacetValue(javax.faces.context.FacesContext context, T table, UIColumn column, AtomicInteger colIndex, ColumnValue columnValue) -
exportCellValue
protected abstract void exportCellValue(javax.faces.context.FacesContext context, T table, UIColumn col, ColumnValue columnValue, int index) -
exportPageOnly
-
exportAll
-
exportSelectionOnly
-
preExport
- Throws:
IOException
-
postExport
- Throws:
IOException
-
preRowExport
-
postRowExport
-
createDocument
- Throws:
IOException
-
getExportableColumns
Gets and caches the list of UIColumns that are exportable="true", visible="true", and rendered="true". Orders them by displayPriority so they match the UI display of the columns.- Parameters:
table- the Table with columns to export- Returns:
- the List
that are exportable
-
options
-
os
-
getOnTableRenderArgs
-
getComponentValue
public String getComponentValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) -
getColumnValue
public ColumnValue getColumnValue(javax.faces.context.FacesContext context, UITable table, UIColumn column, boolean joinComponents) -
getComponentFacetValue
-
getColumnFacetValue
public ColumnValue getColumnFacetValue(javax.faces.context.FacesContext context, UIColumn column, TableExporter.ColumnType columnType) -
getColumnExportTag
-