|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.render.Renderer
org.apache.myfaces.renderkit.html.HtmlRenderer
org.apache.myfaces.renderkit.html.HtmlTableRendererBase
public class HtmlTableRendererBase
Common methods for renderers for components that subclass the standard JSF HtmlDataTable component.
| Field Summary | |
|---|---|
protected static java.lang.String |
FOOTER_FACET_NAME
Footer facet name. |
protected static java.lang.String |
HEADER_FACET_NAME
Header facet name. |
| Constructor Summary | |
|---|---|
HtmlTableRendererBase()
|
|
| Method Summary | |
|---|---|
protected void |
afterBody(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
Perform any operations necessary immediately after the TBODY end tag is output. |
protected void |
afterRow(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
Perform any operations necessary immediately after each TR end tag is output. |
protected void |
afterTable(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
Perform any operations necessary immediately after the TABLE end tag is output. |
protected void |
beforeBody(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
Perform any operations necessary after TABLE start tag is output but before the TBODY start tag. |
protected void |
beforeRow(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
Perform any operations necessary immediately before each TR start tag is output. |
protected void |
beforeTable(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
Perform any operations necessary immediately before the TABLE start tag is output. |
void |
decode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
|
protected int |
determineChildColSpan(javax.faces.component.UIComponent uiComponent)
Calculate the number of columns the specified child component will span when rendered. |
void |
encodeBegin(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent uiComponent)
Render the necessary bits that come before any actual rows in the table. |
void |
encodeChildren(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
Render the TBODY section of the html table. |
protected void |
encodeColumnChild(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData,
javax.faces.component.UIComponent component,
java.util.Iterator columnStyleIterator)
|
void |
encodeEnd(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent uiComponent)
|
void |
encodeInnerHtml(javax.faces.context.FacesContext facesContext,
javax.faces.component.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 static java.lang.String |
getFooterClass(javax.faces.component.UIComponent component)
Gets the footerClass attribute of the given UIComponent. |
protected static java.lang.String |
getHeaderClass(javax.faces.component.UIComponent component)
Gets the headerClass attribute of the given UIComponent. |
boolean |
getRendersChildren()
|
protected boolean |
hasFacet(boolean header,
javax.faces.component.UIComponent uiComponent)
|
protected void |
renderColumnBody(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData,
javax.faces.component.UIComponent component,
java.util.Iterator columnStyleIterator)
Renders the body of a given UIColumn (everything but
the header and footer facets). |
protected void |
renderColumnChildHeaderOrFooterRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent uiComponent,
java.lang.String styleClass,
boolean header)
|
protected void |
renderColumnFooterCell(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIColumn uiColumn,
java.lang.String footerStyleClass,
int colspan)
Renders the footer facet for the given UIColumn. |
protected void |
renderColumnFooterCell(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent uiComponent,
javax.faces.component.UIComponent facet,
java.lang.String footerStyleClass,
int colspan)
Renders the footer facet for the given UIColumn. |
protected void |
renderColumnFooterRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.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(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIColumn uiColumn,
java.lang.String headerStyleClass,
int colspan)
Renders the header facet for the given UIColumn. |
protected void |
renderColumnHeaderCell(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent uiComponent,
javax.faces.component.UIComponent facet,
java.lang.String headerStyleClass,
int colspan)
Renders a TH cell within a TR within a THEAD section. |
protected void |
renderColumnHeaderRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.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(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.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(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData)
Renders the end of a row of body content. |
protected void |
renderRowStart(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData,
java.util.Iterator rowStyleIterator)
Renders the start of a new row of body content. |
protected void |
renderRowStyle(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData,
java.util.Iterator rowStyleIterator)
|
protected void |
renderTableFooterRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
javax.faces.component.UIComponent footerFacet,
java.lang.String footerStyleClass,
int colspan)
Renders the footer row of the table being rendered. |
protected void |
renderTableHeaderRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
javax.faces.component.UIComponent headerFacet,
java.lang.String headerStyleClass,
int colspan)
Renders the header row of the table being rendered. |
| Methods inherited from class org.apache.myfaces.renderkit.html.HtmlRenderer |
|---|
getActionUrl, getChildCount, getChildren |
| Methods inherited from class javax.faces.render.Renderer |
|---|
convertClientId, getConvertedValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String HEADER_FACET_NAME
protected static final java.lang.String FOOTER_FACET_NAME
| Constructor Detail |
|---|
public HtmlTableRendererBase()
| Method Detail |
|---|
public boolean getRendersChildren()
getRendersChildren in class javax.faces.render.RendererRenderer.getRendersChildren()
public void encodeBegin(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent uiComponent)
throws java.io.IOException
encodeBegin in class javax.faces.render.Rendererjava.io.IOExceptionRenderer.encodeBegin(FacesContext, UIComponent)
public void encodeChildren(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
throws java.io.IOException
encodeChildren in class javax.faces.render.Rendererjava.io.IOExceptionRenderer.encodeChildren(FacesContext, UIComponent)
public void encodeInnerHtml(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent component)
throws java.io.IOException
This method is separated from the encodeChildren so that it can be overridden by subclasses. One class that uses this functionality is autoUpdateDataTable.
java.io.IOException
protected void encodeColumnChild(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData,
javax.faces.component.UIComponent component,
java.util.Iterator columnStyleIterator)
throws java.io.IOException
java.io.IOException
protected void renderColumnBody(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData,
javax.faces.component.UIComponent component,
java.util.Iterator columnStyleIterator)
throws java.io.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.columnStyleIterator - the styleClass of the UIColumn or null if
there is none.
java.io.IOException - if an exception occurs.
protected void renderRowStart(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData,
java.util.Iterator rowStyleIterator)
throws java.io.IOException
facesContext - the FacesContext.writer - the ResponseWriter.uiData - the UIData being rendered.rowStyleIterator - te styleClass of the row or null if there is none.
java.io.IOException - if an exceptoin occurs.
protected void renderRowStyle(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData,
java.util.Iterator rowStyleIterator)
throws java.io.IOException
java.io.IOException
protected void renderRowEnd(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIData uiData)
throws java.io.IOException
facesContext - the FacesContext.writer - the ResponseWriter.uiData - the UIData being rendered.
java.io.IOException - if an exceptoin occurs.
protected void beforeTable(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
throws java.io.IOException
facesContext - the FacesContext.uiData - the UIData being rendered.
java.io.IOException
protected void beforeBody(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
throws java.io.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.
java.io.IOException
protected void beforeRow(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
throws java.io.IOException
facesContext - the FacesContext.uiData - the UIData being rendered.
java.io.IOException
protected void afterRow(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
throws java.io.IOException
facesContext - the FacesContext.uiData - the UIData being rendered.
java.io.IOException
protected void afterBody(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
throws java.io.IOException
facesContext - the FacesContext.uiData - the UIData being rendered.
java.io.IOException
protected void afterTable(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIData uiData)
throws java.io.IOException
facesContext - the FacesContext.uiData - the UIData being rendered.
java.io.IOException
public void encodeEnd(javax.faces.context.FacesContext facesContext,
javax.faces.component.UIComponent uiComponent)
throws java.io.IOException
encodeEnd in class javax.faces.render.Rendererjava.io.IOExceptionRenderer.encodeEnd(FacesContext, UIComponent)
protected void renderFacet(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
boolean header)
throws java.io.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).
java.io.IOException - if an exception occurs.
protected boolean hasFacet(boolean header,
javax.faces.component.UIComponent uiComponent)
header - uiComponent -
protected int determineChildColSpan(javax.faces.component.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(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
javax.faces.component.UIComponent headerFacet,
java.lang.String headerStyleClass,
int colspan)
throws java.io.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.
java.io.IOException - if an exception occurs.
protected void renderTableFooterRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
javax.faces.component.UIComponent footerFacet,
java.lang.String footerStyleClass,
int colspan)
throws java.io.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.
java.io.IOException - if an exception occurs.
protected void renderColumnHeaderRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String headerStyleClass)
throws java.io.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 header
java.io.IOException - if an exception occurs.
protected void renderColumnFooterRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent component,
java.lang.String footerStyleClass)
throws java.io.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 footerStyleClass
java.io.IOException - if an exception occurs.
protected void renderColumnChildHeaderOrFooterRow(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent uiComponent,
java.lang.String styleClass,
boolean header)
throws java.io.IOException
java.io.IOException
protected void renderColumnHeaderCell(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIColumn uiColumn,
java.lang.String headerStyleClass,
int colspan)
throws java.io.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.
java.io.IOException
protected void renderColumnHeaderCell(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent uiComponent,
javax.faces.component.UIComponent facet,
java.lang.String headerStyleClass,
int colspan)
throws java.io.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.
java.io.IOException
protected void renderColumnFooterCell(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIColumn uiColumn,
java.lang.String footerStyleClass,
int colspan)
throws java.io.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.
java.io.IOException
protected void renderColumnFooterCell(javax.faces.context.FacesContext facesContext,
javax.faces.context.ResponseWriter writer,
javax.faces.component.UIComponent uiComponent,
javax.faces.component.UIComponent facet,
java.lang.String footerStyleClass,
int colspan)
throws java.io.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.
java.io.IOExceptionprotected static java.lang.String getHeaderClass(javax.faces.component.UIComponent component)
UIComponent.
component - the UIComponent.
UIComponent.protected static java.lang.String getFooterClass(javax.faces.component.UIComponent component)
UIComponent.
component - the UIComponent.
UIComponent.
public void decode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
decode in class javax.faces.render.Renderer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||