public class HtmlTableRendererBase extends HtmlRenderer
Modifier and Type | Class and Description |
---|---|
protected static class |
HtmlTableRendererBase.Styles
Class manages the styles from String lists.
|
Modifier and Type | Field and Description |
---|---|
protected static String |
CAPTION_FACET_NAME |
protected static String |
FOOTER_FACET_NAME
Footer facet name.
|
protected static String |
HEADER_FACET_NAME
Header facet name.
|
Constructor and Description |
---|
HtmlTableRendererBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterBody(FacesContext facesContext,
UIData uiData)
Perform any operations necessary immediately after the TBODY end tag
is output.
|
protected void |
afterColumn(FacesContext facesContext,
UIData uiData,
int columnIndex)
Perform any operations necessary immediately after each column child is rendered
|
protected void |
afterColumnHeaderOrFooter(FacesContext facesContext,
UIData uiData,
boolean header,
int columnIndex)
Perform any operations necessary immediately after each column child's header of footer is rendered
|
protected void |
afterRow(FacesContext facesContext,
UIData uiData)
Perform any operations necessary immediately after each TR end tag
is output.
|
protected void |
afterTable(FacesContext facesContext,
UIData uiData)
Perform any operations necessary immediately after the TABLE end tag
is output.
|
protected void |
beforeBody(FacesContext facesContext,
UIData uiData)
Perform any operations necessary after TABLE start tag is output
but before the TBODY start tag.
|
protected void |
beforeColumn(FacesContext facesContext,
UIData uiData,
int columnIndex)
Perform any operations necessary immediately before each column child is rendered
|
protected void |
beforeColumnHeaderOrFooter(FacesContext facesContext,
UIData uiData,
boolean header,
int columnIndex)
Perform any operations necessary immediately before each column child's header or footer is rendered
|
protected void |
beforeRow(FacesContext facesContext,
UIData uiData)
Perform any operations necessary immediately before each TR start tag
is output.
|
protected void |
beforeTable(FacesContext facesContext,
UIData uiData)
Perform any operations necessary immediately before the TABLE start tag
is output.
|
void |
decode(FacesContext context,
UIComponent component) |
protected int |
determineChildColSpan(UIComponent uiComponent)
Calculate the number of columns the specified child component will span
when rendered.
|
protected String |
determineHeaderCellTag(FacesContext facesContext,
UIComponent uiComponent) |
protected String |
determineHeaderFooterTag(FacesContext facesContext,
UIComponent component,
boolean header) |
void |
encodeBegin(FacesContext facesContext,
UIComponent uiComponent)
Render the necessary bits that come before any actual rows in the table.
|
void |
encodeChildren(FacesContext facesContext,
UIComponent component)
Render the TBODY section of the html table.
|
protected void |
encodeColumnChild(FacesContext facesContext,
ResponseWriter writer,
UIData uiData,
UIComponent component,
HtmlTableRendererBase.Styles styles,
int columnStyleIndex) |
void |
encodeEnd(FacesContext facesContext,
UIComponent uiComponent) |
void |
encodeInnerHtml(FacesContext facesContext,
UIComponent component)
Renders everything inside the TBODY tag by iterating over the row objects
between offsets first and first+rows and applying the UIColumn components
to those objects.
|
protected void |
endTable(FacesContext facesContext,
UIComponent uiComponent)
actually render the end of the table
|
protected int |
getColumnCountForComponent(FacesContext facesContext,
UIData uiData,
UIComponent child)
Indicates the number of columns the component represents.
|
protected static String |
getFooterClass(UIComponent component)
Gets the footerClass attribute of the given
UIComponent . |
protected static String |
getHeaderClass(UIComponent component)
Gets the headerClass attribute of the given
UIComponent . |
protected int |
getNewspaperColumns(UIComponent component) |
protected UIComponent |
getNewspaperTableSpacer(UIComponent component) |
boolean |
getRendersChildren() |
protected static HtmlTableRendererBase.Styles |
getStyles(UIData uiData)
Gets styles for the specified component.
|
protected boolean |
hasFacet(boolean header,
UIComponent uiComponent) |
protected boolean |
hasNewspaperTableSpacer(UIComponent component) |
protected void |
inBodyStart(FacesContext facesContext,
UIData uiData)
Perform any operations necessary in the TBODY start tag.
|
protected boolean |
isNewspaperHorizontalOrientation(UIComponent component) |
protected void |
renderCaptionFacet(FacesContext facesContext,
ResponseWriter writer,
UIComponent component)
Renders the caption facet.
|
protected void |
renderColgroupsFacet(FacesContext facesContext,
ResponseWriter writer,
UIComponent component)
Renders the colgroups facet.
|
protected void |
renderColumnBody(FacesContext facesContext,
ResponseWriter writer,
UIData uiData,
UIComponent component,
HtmlTableRendererBase.Styles styles,
int columnStyleIndex)
Renders the body of a given
UIColumn (everything but
the header and footer facets). |
protected void |
renderColumnChildHeaderOrFooterRow(FacesContext facesContext,
ResponseWriter writer,
UIComponent uiComponent,
String styleClass,
boolean isHeader) |
protected void |
renderColumnFooterCell(FacesContext facesContext,
ResponseWriter writer,
UIColumn uiColumn,
String footerStyleClass,
int colspan)
Renders the footer facet for the given
UIColumn . |
protected void |
renderColumnFooterCell(FacesContext facesContext,
ResponseWriter writer,
UIComponent uiComponent,
UIComponent facet,
String footerStyleClass,
int colspan)
Renders the footer facet for the given
UIColumn . |
protected void |
renderColumnFooterRow(FacesContext facesContext,
ResponseWriter writer,
UIComponent component,
String footerStyleClass)
Renders the footer row for the columns, which is a separate row from the footer row for the
UIData footer facet. |
protected void |
renderColumnHeaderCell(FacesContext facesContext,
ResponseWriter writer,
UIColumn uiColumn,
String headerStyleClass,
int colspan)
Renders the header facet for the given
UIColumn . |
protected void |
renderColumnHeaderCell(FacesContext facesContext,
ResponseWriter writer,
UIComponent uiComponent,
UIComponent facet,
String headerStyleClass,
int colspan)
Renders a TH cell within a TR within a THEAD section.
|
protected void |
renderColumnHeaderRow(FacesContext facesContext,
ResponseWriter writer,
UIComponent component,
String headerStyleClass)
Renders the header row for the columns, which is a separate row from the header row for the
UIData header facet. |
protected void |
renderFacet(FacesContext facesContext,
ResponseWriter writer,
UIComponent component,
boolean header)
Renders either the header or the footer facets for the UIData component
and all the child UIColumn components, as a THEAD or TFOOT element
containing TR (row) elements.
|
protected void |
renderRowEnd(FacesContext facesContext,
ResponseWriter writer,
UIData uiData)
Renders the end of a row of body content.
|
protected void |
renderRowStart(FacesContext facesContext,
ResponseWriter writer,
UIData uiData,
HtmlTableRendererBase.Styles styles,
int rowStyleIndex)
Renders the start of a new row of body content.
|
protected void |
renderRowStyle(FacesContext facesContext,
ResponseWriter writer,
UIData uiData,
HtmlTableRendererBase.Styles styles,
int rowStyleIndex) |
protected void |
renderSpacerCell(FacesContext facesContext,
ResponseWriter writer,
UIComponent component)
Renders a spacer between adjacent newspaper columns.
|
protected void |
renderTableFooterRow(FacesContext facesContext,
ResponseWriter writer,
UIComponent component,
UIComponent footerFacet,
String footerStyleClass,
int colspan)
Renders the footer row of the table being rendered.
|
protected void |
renderTableHeaderOrFooterRow(FacesContext facesContext,
ResponseWriter writer,
UIComponent component,
UIComponent facet,
String styleClass,
String colElementName,
int colspan,
boolean isHeader) |
protected void |
renderTableHeaderRow(FacesContext facesContext,
ResponseWriter writer,
UIComponent component,
UIComponent headerFacet,
String headerStyleClass,
int colspan)
Renders the header row of the table being rendered.
|
protected void |
startTable(FacesContext facesContext,
UIComponent uiComponent)
actually render the start of the table
|
getActionUrl, getChildCount, getChildren, getClientId, isCommonEventsOptimizationEnabled, isCommonPropertiesOptimizationEnabled, renderId, shouldRenderId, toUri
convertClientId, getConvertedValue
protected static final String HEADER_FACET_NAME
protected static final String FOOTER_FACET_NAME
protected static final String CAPTION_FACET_NAME
protected int getNewspaperColumns(UIComponent component)
component
- dataTableprotected UIComponent getNewspaperTableSpacer(UIComponent component)
component
- dataTableprotected boolean hasNewspaperTableSpacer(UIComponent component)
component
- dataTableprotected boolean isNewspaperHorizontalOrientation(UIComponent component)
component
- dataTablepublic boolean getRendersChildren()
getRendersChildren
in class Renderer
Renderer.getRendersChildren()
public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException
encodeBegin
in class Renderer
IOException
Renderer.encodeBegin(FacesContext, UIComponent)
protected void startTable(FacesContext facesContext, UIComponent uiComponent) throws IOException
IOException
public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException
encodeChildren
in class Renderer
IOException
Renderer.encodeChildren(FacesContext, UIComponent)
protected void renderCaptionFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component) throws IOException
facesContext
- the FacesContext
.writer
- the ResponseWriter
.component
- the parent UIComponent
containing the facets.IOException
- if an exception occurs.protected void renderColgroupsFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component) throws IOException
facesContext
- the FacesContext
.writer
- the ResponseWriter
.component
- the parent UIComponent
containing the facets.IOException
- if an exception occurs.protected static HtmlTableRendererBase.Styles getStyles(UIData uiData)
public void encodeInnerHtml(FacesContext facesContext, UIComponent component) throws IOException
This method is separated from the encodeChildren so that it can be overridden by subclasses. One class that uses this functionality is autoUpdateDataTable.
IOException
protected void encodeColumnChild(FacesContext facesContext, ResponseWriter writer, UIData uiData, UIComponent component, HtmlTableRendererBase.Styles styles, int columnStyleIndex) throws IOException
IOException
protected void renderColumnBody(FacesContext facesContext, ResponseWriter writer, UIData uiData, UIComponent component, HtmlTableRendererBase.Styles styles, int columnStyleIndex) throws IOException
UIColumn
(everything but
the header and footer facets). This emits a TD cell, whose contents
are the result of calling encodeBegin, encodeChildren and
encodeEnd methods on the component (or its associated renderer).facesContext
- the FacesContext
.writer
- the ResponseWriter
.uiData
- the UIData
being rendered.component
- the UIComponent
to render.IOException
- if an exception occurs.protected void renderRowStart(FacesContext facesContext, ResponseWriter writer, UIData uiData, HtmlTableRendererBase.Styles styles, int rowStyleIndex) throws IOException
facesContext
- the FacesContext
.writer
- the ResponseWriter
.uiData
- the UIData
being rendered.IOException
- if an exceptoin occurs.protected void renderRowStyle(FacesContext facesContext, ResponseWriter writer, UIData uiData, HtmlTableRendererBase.Styles styles, int rowStyleIndex) throws IOException
IOException
protected void renderRowEnd(FacesContext facesContext, ResponseWriter writer, UIData uiData) throws IOException
facesContext
- the FacesContext
.writer
- the ResponseWriter
.uiData
- the UIData
being rendered.IOException
- if an exceptoin occurs.protected void beforeTable(FacesContext facesContext, UIData uiData) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.IOException
protected void beforeBody(FacesContext facesContext, UIData uiData) throws IOException
This method generates the THEAD/TFOOT sections of a table if there are any header or footer facets defined on the table or on any child UIColumn component.
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.IOException
protected void beforeRow(FacesContext facesContext, UIData uiData) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.IOException
protected void afterRow(FacesContext facesContext, UIData uiData) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.IOException
protected void beforeColumn(FacesContext facesContext, UIData uiData, int columnIndex) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.columnIndex
- the index of the currenly rendered columnIOException
protected void afterColumn(FacesContext facesContext, UIData uiData, int columnIndex) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.columnIndex
- the index of the currenly rendered columnIOException
protected int getColumnCountForComponent(FacesContext facesContext, UIData uiData, UIComponent child)
facesContext
- uiData
- child
- protected void beforeColumnHeaderOrFooter(FacesContext facesContext, UIData uiData, boolean header, int columnIndex) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.header
- true if the header of the column child is renderedcolumnIndex
- the index of the currenly rendered columnIOException
protected void afterColumnHeaderOrFooter(FacesContext facesContext, UIData uiData, boolean header, int columnIndex) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.header
- true if the header of the column child is renderedcolumnIndex
- the index of the currenly rendered columnIOException
protected void inBodyStart(FacesContext facesContext, UIData uiData) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.IOException
protected void afterBody(FacesContext facesContext, UIData uiData) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.IOException
protected void afterTable(FacesContext facesContext, UIData uiData) throws IOException
facesContext
- the FacesContext
.uiData
- the UIData
being rendered.IOException
public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException
encodeEnd
in class Renderer
IOException
Renderer.encodeEnd(FacesContext, UIComponent)
protected void endTable(FacesContext facesContext, UIComponent uiComponent) throws IOException
IOException
protected void renderFacet(FacesContext facesContext, ResponseWriter writer, UIComponent component, boolean header) throws IOException
If there is a header or footer attached to the UIData then that is rendered as a TR element whose COLSPAN is the sum of all rendered columns in the table. This allows that header/footer to take up the entire width of the table.
If any child column has a header or footer then a TR is rendered with a TH cell for each column child.
facesContext
- the FacesContext
.writer
- the ResponseWriter
.component
- the UIData componentheader
- whether this is the header facet (if not, then the footer facet).IOException
- if an exception occurs.protected String determineHeaderFooterTag(FacesContext facesContext, UIComponent component, boolean header)
protected boolean hasFacet(boolean header, UIComponent uiComponent)
header
- uiComponent
- protected int determineChildColSpan(UIComponent uiComponent)
Normally, this is a fairly simple calculation: a UIColumn component is rendered as one column, every other child type is not rendered (ie spans zero columns). However custom subclasses of this renderer may override this method to handle cases where a single component renders as multiple columns.
protected void renderTableHeaderRow(FacesContext facesContext, ResponseWriter writer, UIComponent component, UIComponent headerFacet, String headerStyleClass, int colspan) throws IOException
facesContext
- the FacesContext
.writer
- the ResponseWriter
.component
- the UIComponent
for whom a table is being rendered.headerFacet
- the facet for the header.headerStyleClass
- the styleClass of the header.colspan
- the number of columns the header should span. Typically, this is
the number of columns in the table.IOException
- if an exception occurs.protected void renderTableFooterRow(FacesContext facesContext, ResponseWriter writer, UIComponent component, UIComponent footerFacet, String footerStyleClass, int colspan) throws IOException
facesContext
- the FacesContext
.writer
- the ResponseWriter
.component
- the UIComponent
for whom a table is being rendered.footerFacet
- the facet for the footer.footerStyleClass
- the styleClass of the footer.colspan
- the number of columns the header should span. Typically, this is
the number of columns in the table.IOException
- if an exception occurs.protected void renderColumnHeaderRow(FacesContext facesContext, ResponseWriter writer, UIComponent component, String headerStyleClass) throws IOException
UIData
header facet.facesContext
- the FacesContext
.writer
- the ResponseWriter
.component
- the UIData component for whom a table is being rendered.headerStyleClass
- the styleClass of the headerIOException
- if an exception occurs.protected void renderColumnFooterRow(FacesContext facesContext, ResponseWriter writer, UIComponent component, String footerStyleClass) throws IOException
UIData
footer facet.facesContext
- the FacesContext
.writer
- the ResponseWriter
.component
- the UIComponent
for whom a table is being rendered.footerStyleClass
- the styleClass of the footerStyleClassIOException
- if an exception occurs.protected void renderTableHeaderOrFooterRow(FacesContext facesContext, ResponseWriter writer, UIComponent component, UIComponent facet, String styleClass, String colElementName, int colspan, boolean isHeader) throws IOException
IOException
protected void renderSpacerCell(FacesContext facesContext, ResponseWriter writer, UIComponent component) throws IOException
IOException
protected void renderColumnChildHeaderOrFooterRow(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, String styleClass, boolean isHeader) throws IOException
IOException
protected void renderColumnHeaderCell(FacesContext facesContext, ResponseWriter writer, UIColumn uiColumn, String headerStyleClass, int colspan) throws IOException
UIColumn
.facesContext
- the FacesContext
.writer
- the ResponseWriter
.uiColumn
- the UIColumn
.headerStyleClass
- the styleClass of the header facet.colspan
- the colspan for the tableData element in which the header facet
will be wrapped.IOException
protected void renderColumnHeaderCell(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, UIComponent facet, String headerStyleClass, int colspan) throws IOException
facesContext
- the FacesContext
.writer
- the ResponseWriter
.uiComponent
- the UIComponent
to render the facet for.facet
- the UIComponent
to render as facet.headerStyleClass
- the styleClass of the header facet.colspan
- the colspan for the tableData element in which the header facet
will be wrapped.IOException
protected String determineHeaderCellTag(FacesContext facesContext, UIComponent uiComponent)
protected void renderColumnFooterCell(FacesContext facesContext, ResponseWriter writer, UIColumn uiColumn, String footerStyleClass, int colspan) throws IOException
UIColumn
.facesContext
- the FacesContext
.writer
- the ResponseWriter
.uiColumn
- the UIComponent
.footerStyleClass
- the styleClass of the footer facet.colspan
- the colspan for the tableData element in which the footer facet
will be wrapped.IOException
protected void renderColumnFooterCell(FacesContext facesContext, ResponseWriter writer, UIComponent uiComponent, UIComponent facet, String footerStyleClass, int colspan) throws IOException
UIColumn
.facesContext
- the FacesContext
.writer
- the ResponseWriter
.uiComponent
- the UIComponent
to render the facet for.facet
- the UIComponent
to render as facet.footerStyleClass
- the styleClass of the footer facet.colspan
- the colspan for the tableData element in which the footer facet
will be wrapped.IOException
protected static String getHeaderClass(UIComponent component)
UIComponent
.component
- the UIComponent
.UIComponent
.protected static String getFooterClass(UIComponent component)
UIComponent
.component
- the UIComponent
.UIComponent
.public void decode(FacesContext context, UIComponent component)
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.