org.apache.myfaces.renderkit.html.ext
Class HtmlTableRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRenderer
          extended by org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
              extended by org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer

public class HtmlTableRenderer
extends org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase

Renderer for the Tomahawk extended HtmlDataTable component.

Version:
$Revision: 491565 $ $Date: 2007-01-01 13:54:00 +0100 (Mo, 01 Jan 2007) $
Author:
Manfred Geiler (latest modification by $Author: paulsp $)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles
 
Field Summary
static java.lang.String DETAIL_STAMP_FACET_NAME
          DetailStamp facet name.
 
Fields inherited from class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
FOOTER_FACET_NAME, HEADER_FACET_NAME
 
Constructor Summary
HtmlTableRenderer()
           
 
Method Summary
protected  void afterRow(javax.faces.context.FacesContext facesContext, javax.faces.component.UIData uiData)
           
protected  boolean amISpannedOver(java.lang.String prefix, javax.faces.component.UIComponent component)
          specify if the header, footer or is spanned over (not shown) because of a colspan in a cell in a previous column
protected  void beforeBody(javax.faces.context.FacesContext facesContext, javax.faces.component.UIData uiData)
           
protected  void beforeColumn(javax.faces.context.FacesContext facesContext, javax.faces.component.UIData uiData, int columnIndex)
           
protected  void beforeColumnHeaderOrFooter(javax.faces.context.FacesContext facesContext, javax.faces.component.UIData uiData, boolean header, int columnIndex)
           
protected  int determineChildColSpan(javax.faces.component.UIComponent uiComponent)
          Return the number of columns spanned by the specified component.
protected  boolean determineRenderFacet(javax.faces.component.UIComponent component, boolean header)
          determine if the header or footer should be rendered.
 void encodeBegin(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
           
 void encodeChildren(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent component)
           
protected  void encodeColumnChild(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer, javax.faces.component.UIData uiData, javax.faces.component.UIComponent component, org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles styles, int columnStyleIndex)
          Render the specified column object using the current row data.
 void encodeEnd(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent)
           
protected  int getNewspaperColumns(javax.faces.component.UIComponent component)
           
protected  javax.faces.component.UIComponent getNewspaperTableSpacer(javax.faces.component.UIComponent component)
           
protected  boolean hasFacet(boolean header, javax.faces.component.UIComponent uiComponent)
          Return true if the specified component has a facet that needs to be rendered in a THEAD or TFOOT section.
protected  boolean hasNewspaperTableSpacer(javax.faces.component.UIComponent component)
           
protected  void inBodyStart(javax.faces.context.FacesContext facesContext, javax.faces.component.UIData uiData)
          Perform any operations necessary in the TBODY start tag.
protected  boolean isNewspaperHorizontalOrientation(javax.faces.component.UIComponent component)
           
protected  void putSortedReqScopeParam(javax.faces.context.FacesContext facesContext, HtmlDataTable dataTable, int columnIndex)
           
protected  void renderColumnBody(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer, javax.faces.component.UIData uiData, javax.faces.component.UIComponent component, org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles styles, int columnStyleIndex)
           
protected  void renderColumnChildHeaderOrFooterRow(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent uiComponent, java.lang.String styleClass, boolean header)
          Render the header or footer of the specified column object.
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)
           
protected  void renderColumnFooterRow(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String footerStyleClass)
          Renders the column footer.
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)
           
protected  void renderColumnHeaderRow(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent component, java.lang.String headerStyleClass)
          Renders the column header.
protected  void renderHtmlColumnAttributes(javax.faces.context.ResponseWriter writer, javax.faces.component.UIComponent uiComponent, java.lang.String prefix)
           
protected  void renderRowAttribute(javax.faces.context.ResponseWriter writer, java.lang.String htmlAttribute, java.lang.Object value)
           
protected  void renderRowStart(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer, javax.faces.component.UIData uiData, org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles styles, int rowStyleIndex)
           
protected  void renderRowStyle(javax.faces.context.FacesContext facesContext, javax.faces.context.ResponseWriter writer, javax.faces.component.UIData uiData, org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles styles, int rowStyleIndex)
           
 
Methods inherited from class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
afterBody, afterColumn, afterColumnHeaderOrFooter, afterTable, beforeRow, beforeTable, decode, encodeInnerHtml, getFooterClass, getHeaderClass, getRendersChildren, getStyles, renderColumnFooterCell, renderColumnHeaderCell, renderFacet, renderRowEnd, renderSpacerCell, renderTableFooterRow, renderTableHeaderRow
 
Methods inherited from class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRenderer
getActionUrl, getChildCount, getChildren, getClientId, renderId, shouldRenderId, toUri
 
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

DETAIL_STAMP_FACET_NAME

public static final java.lang.String DETAIL_STAMP_FACET_NAME
DetailStamp facet name.

See Also:
Constant Field Values
Constructor Detail

HtmlTableRenderer

public HtmlTableRenderer()
Method Detail

getNewspaperColumns

protected int getNewspaperColumns(javax.faces.component.UIComponent component)
Overrides:
getNewspaperColumns in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Parameters:
component - dataTable
Returns:
number of layout columns

getNewspaperTableSpacer

protected javax.faces.component.UIComponent getNewspaperTableSpacer(javax.faces.component.UIComponent component)
Overrides:
getNewspaperTableSpacer in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Parameters:
component - dataTable
Returns:
component to display between layout columns

hasNewspaperTableSpacer

protected boolean hasNewspaperTableSpacer(javax.faces.component.UIComponent component)
Overrides:
hasNewspaperTableSpacer in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Parameters:
component - dataTable
Returns:
whether dataTable has component to display between layout columns

isNewspaperHorizontalOrientation

protected boolean isNewspaperHorizontalOrientation(javax.faces.component.UIComponent component)
Overrides:
isNewspaperHorizontalOrientation in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Parameters:
component - dataTable
Returns:
if the orientation of the has newspaper columns is horizontal

afterRow

protected void afterRow(javax.faces.context.FacesContext facesContext,
                        javax.faces.component.UIData uiData)
                 throws java.io.IOException
Overrides:
afterRow in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext facesContext,
                        javax.faces.component.UIComponent uiComponent)
                 throws java.io.IOException
Overrides:
encodeBegin in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
HtmlTableRendererBase.encodeBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext facesContext,
                           javax.faces.component.UIComponent component)
                    throws java.io.IOException
Overrides:
encodeChildren in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
HtmlTableRendererBase.encodeChildren(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

beforeBody

protected void beforeBody(javax.faces.context.FacesContext facesContext,
                          javax.faces.component.UIData uiData)
                   throws java.io.IOException
Overrides:
beforeBody in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext facesContext,
                      javax.faces.component.UIComponent uiComponent)
               throws java.io.IOException
Overrides:
encodeEnd in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
HtmlTableRendererBase.encodeEnd(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

renderRowStart

protected void renderRowStart(javax.faces.context.FacesContext facesContext,
                              javax.faces.context.ResponseWriter writer,
                              javax.faces.component.UIData uiData,
                              org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles styles,
                              int rowStyleIndex)
                       throws java.io.IOException
Overrides:
renderRowStart in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException

renderRowStyle

protected void renderRowStyle(javax.faces.context.FacesContext facesContext,
                              javax.faces.context.ResponseWriter writer,
                              javax.faces.component.UIData uiData,
                              org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles styles,
                              int rowStyleIndex)
                       throws java.io.IOException
Overrides:
renderRowStyle in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase#renderRowStyle(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, javax.faces.component.UIData, java.util.Iterator)

renderRowAttribute

protected void renderRowAttribute(javax.faces.context.ResponseWriter writer,
                                  java.lang.String htmlAttribute,
                                  java.lang.Object value)
                           throws java.io.IOException
Throws:
java.io.IOException

encodeColumnChild

protected void encodeColumnChild(javax.faces.context.FacesContext facesContext,
                                 javax.faces.context.ResponseWriter writer,
                                 javax.faces.component.UIData uiData,
                                 javax.faces.component.UIComponent component,
                                 org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles styles,
                                 int columnStyleIndex)
                          throws java.io.IOException
Render the specified column object using the current row data.

When the component is a UIColumn object, the inherited method is invoked to render a single table cell.

In addition to the inherited functionality, support is implemented here for UIColumns children. When a UIColumns child is encountered:

 For each dynamic column in that UIColumns child:
   * Select the column (which sets variable named by the var attribute
     to refer to the current column object) 
   * Call this.renderColumnBody passing the UIColumns object.
 
The renderColumnBody method eventually: If the children of the UIColumns access the variable named by the var attribute on the UIColumns object, then they end up rendering content that is extracted from the current column object.

Overrides:
encodeColumnChild in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase#encodeColumnChild(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, javax.faces.component.UIData, javax.faces.component.UIComponent, java.util.Iterator)

renderColumnBody

protected void renderColumnBody(javax.faces.context.FacesContext facesContext,
                                javax.faces.context.ResponseWriter writer,
                                javax.faces.component.UIData uiData,
                                javax.faces.component.UIComponent component,
                                org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.Styles styles,
                                int columnStyleIndex)
                         throws java.io.IOException
Overrides:
renderColumnBody in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase#renderColumnBody(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, javax.faces.component.UIData, javax.faces.component.UIComponent, java.util.Iterator)

renderColumnChildHeaderOrFooterRow

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
Render the header or footer of the specified column object.

When the component is a UIColumn object, the inherited method is invoked to render a single header cell.

In addition to the inherited functionality, support is implemented here for UIColumns children. When a UIColumns child is encountered:

 For each dynamic column in that UIColumns child:
   * Select the column (which sets variable named by the var attribute
     to refer to the current column object) 
   * Call this.renderColumnHeaderCell or this.renderColumnFooterCell
     passing the header or footer facet of the UIColumns object.
 
If the facet of the UIColumns accesses the variable named by the var attribute on the UIColumns object, then it ends up rendering content that is extracted from the current column object.

Overrides:
renderColumnChildHeaderOrFooterRow in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
HtmlTableRendererBase.renderColumnChildHeaderOrFooterRow(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, javax.faces.component.UIComponent, java.lang.String, boolean)

renderColumnHeaderCell

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
Overrides:
renderColumnHeaderCell in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
HtmlTableRendererBase.renderColumnHeaderCell(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, javax.faces.component.UIComponent, javax.faces.component.UIComponent, java.lang.String, int)

renderColumnFooterCell

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
Overrides:
renderColumnFooterCell in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException
See Also:
HtmlTableRendererBase.renderColumnFooterCell(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, javax.faces.component.UIComponent, javax.faces.component.UIComponent, java.lang.String, int)

renderHtmlColumnAttributes

protected void renderHtmlColumnAttributes(javax.faces.context.ResponseWriter writer,
                                          javax.faces.component.UIComponent uiComponent,
                                          java.lang.String prefix)
                                   throws java.io.IOException
Throws:
java.io.IOException

determineChildColSpan

protected int determineChildColSpan(javax.faces.component.UIComponent uiComponent)
Return the number of columns spanned by the specified component.

For normal components, use the inherited implementation. For UIColumns children, return the number of dynamic columns rendered by that child.

Overrides:
determineChildColSpan in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
See Also:
#determineChildColSpan(javax.faces.component.UIComponent)

hasFacet

protected boolean hasFacet(boolean header,
                           javax.faces.component.UIComponent uiComponent)
Return true if the specified component has a facet that needs to be rendered in a THEAD or TFOOT section.

Overrides:
hasFacet in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
See Also:
HtmlTableRendererBase.hasFacet(boolean, javax.faces.component.UIComponent)

renderColumnFooterRow

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
Renders the column footer. Rendering will be supressed if all of the facets have rendered="false"

Overrides:
renderColumnFooterRow in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException

renderColumnHeaderRow

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
Renders the column header. Rendering will be supressed if all of the facets have rendered="false"

Overrides:
renderColumnHeaderRow in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException

determineRenderFacet

protected boolean determineRenderFacet(javax.faces.component.UIComponent component,
                                       boolean header)
determine if the header or footer should be rendered.


beforeColumn

protected void beforeColumn(javax.faces.context.FacesContext facesContext,
                            javax.faces.component.UIData uiData,
                            int columnIndex)
                     throws java.io.IOException
Overrides:
beforeColumn in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException

beforeColumnHeaderOrFooter

protected void beforeColumnHeaderOrFooter(javax.faces.context.FacesContext facesContext,
                                          javax.faces.component.UIData uiData,
                                          boolean header,
                                          int columnIndex)
                                   throws java.io.IOException
Overrides:
beforeColumnHeaderOrFooter in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Throws:
java.io.IOException

putSortedReqScopeParam

protected void putSortedReqScopeParam(javax.faces.context.FacesContext facesContext,
                                      HtmlDataTable dataTable,
                                      int columnIndex)

amISpannedOver

protected boolean amISpannedOver(java.lang.String prefix,
                                 javax.faces.component.UIComponent component)
specify if the header, footer or is spanned over (not shown) because of a colspan in a cell in a previous column

Parameters:
prefix - header, footer or null
uiComponent -

inBodyStart

protected void inBodyStart(javax.faces.context.FacesContext facesContext,
                           javax.faces.component.UIData uiData)
                    throws java.io.IOException
Perform any operations necessary in the TBODY start tag.

Overrides:
inBodyStart in class org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase
Parameters:
facesContext - the FacesContext.
uiData - the UIData being rendered.
Throws:
java.io.IOException


Copyright © 2010. All Rights Reserved.