org.richfaces.renderkit

## Class AbstractTableRenderer

- java.lang.Object
- - javax.faces.render.Renderer
  - - org.ajax4jsf.renderkit.RendererBase
    - - org.ajax4jsf.renderkit.HeaderResourcesRendererBase
      - - org.richfaces.renderkit.AbstractRowsRenderer
        - - org.richfaces.renderkit.AbstractTableRenderer

- All Implemented Interfaces:
    org.ajax4jsf.model.DataVisitor, org.ajax4jsf.renderkit.ChameleonRenderer, org.ajax4jsf.renderkit.HeaderResourceProducer, org.ajax4jsf.renderkit.HeaderResourceProducer2, org.ajax4jsf.resource.ResourceProduser
  Direct Known Subclasses:
    DataTableRenderer, SubTableRenderer

      public abstract class AbstractTableRenderer
      extends AbstractRowsRenderer

  Author:
    shura

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `AbstractTableRenderer.RichHeaderEncodeStrategy`
    `protected class` | `AbstractTableRenderer.SimpleHeaderEncodeStrategy`

  - ### Field Summary

    - ### Fields inherited from class org.richfaces.renderkit.AbstractRowsRenderer

      `CELL_CLASS_KEY, ROW_CLASS_KEY, SKIN_CELL_CLASS_KEY, SKIN_FIRST_ROW_CLASS_KEY, SKIN_ROW_CLASS_KEY, TABLE_EVENT_ATTRS`

    - ### Fields inherited from class org.ajax4jsf.renderkit.RendererBase

      `JAVASCRIPT_NAMESPACE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractTableRenderer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addInplaceInput(javax.faces.context.FacesContext context, javax.faces.component.UIComponent column, java.lang.String buffer)`
    `protected java.lang.String` | `buildAjaxFunction(javax.faces.context.FacesContext context, javax.faces.component.UIComponent column, boolean sortable)`
    `protected int` | `calculateRowColumns(java.util.Iterator<javax.faces.component.UIComponent> col)` Calculate max number of columns per row.
    `protected void` | `doDecode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)`
    `void` | `encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)`
    `void` | `encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)`
    `void` | `encodeFooter(javax.faces.context.FacesContext context, UIDataTable table, int columns)`
    `void` | `encodeHeader(javax.faces.context.FacesContext context, UIDataTable table, int numberOfColumns)`
    `protected void` | `encodeHeaderFacets(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, java.util.Iterator<javax.faces.component.UIComponent> headers, java.lang.String skinCellClass, java.lang.String headerClass, java.lang.String facetName, java.lang.String element, int colCount)`
    `void` | `encodeOneRow(javax.faces.context.FacesContext context, TableHolder holder)`
    `protected void` | `encodeRowEvents(javax.faces.context.FacesContext context, org.ajax4jsf.component.UIDataAdaptor table)`
    `protected void` | `encodeRowStart(javax.faces.context.FacesContext context, java.lang.String skinClass, java.lang.String rowClass, UIDataTable table, javax.faces.context.ResponseWriter writer)`
    `protected void` | `encodeRowStart(javax.faces.context.FacesContext context, java.lang.String rowClass, UIDataTable table, javax.faces.context.ResponseWriter writer)`
    `void` | `encodeTableStructure(javax.faces.context.FacesContext context, UIDataTable table)` Encode all table structure - colgroups definitions, caption, header, footer
    `void` | `encodeTBody(javax.faces.context.FacesContext context, UIDataTable table)` Encode data table body
    `void` | `encodeTBodyAjax(javax.faces.context.FacesContext context, UIDataTable table)` Helper method for rendering data table tBody only.
    `protected java.lang.String` | `getCellSkinClass()`
    `protected int` | `getColumnsCount(UIDataTable table)` Calculate total number of columns in table.
    `protected java.lang.String` | `getFirstRowSkinClass()`
    `protected java.lang.String` | `getRowSkinClass()`
    `protected org.ajax4jsf.resource.InternetResource[]` | `getScripts()`
    `boolean` | `isColumnFacetPresent(UIDataTable table, java.lang.String facetName)`
    `protected boolean` | `isColumnRendered(javax.faces.component.UIComponent component)`
    `boolean` | `isHeaderFactoryColumnAttributePresent(UIDataTable table, java.lang.String attributeName)` Returns true if specified attribute (when present on the column) should generate header even if it is not specified on the table
    `protected boolean` | `isRequiresScripts(javax.faces.context.FacesContext context)`
    `boolean` | `renderBodyOnly(javax.faces.context.FacesContext context, UIDataTable table)` Check whether to render tbody only by Ajax call
    `protected void` | `setRequiresScripts(javax.faces.context.FacesContext context)`

    - ### Methods inherited from class org.richfaces.renderkit.AbstractRowsRenderer

      `doCleanup, encodeCaption, encodeCellChildren, encodeRows, encodeRows, encodeStyle, encodeStyleClass, encodeTableHeaderFacet, getRendersChildren, process`

    - ### Methods inherited from class org.ajax4jsf.renderkit.HeaderResourcesRendererBase

      `encodeResourcesArray, encodeToHead, getHeaderScripts, getHeaderStyles, getStyles`

    - ### Methods inherited from class org.ajax4jsf.renderkit.RendererBase

      `addResource, decode, doEncodeBegin, doEncodeChildren, doEncodeEnd, encodeBegin, getComponentClass, getResource, getSkin, getUtils, preDecode, preEncodeBegin, renderChild, renderChildren`

    - ### 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`

- - ### Constructor Detail

    - #### AbstractTableRenderer

          public AbstractTableRenderer()

  - ### Method Detail

    - #### encodeTBody

          public void encodeTBody(javax.faces.context.FacesContext context,
                         UIDataTable table)
                           throws java.io.IOException

      Encode data table body
      Parameters:
        `context` -
        `table` -
      Throws:
        `java.io.IOException`

    - #### encodeChildren

          public void encodeChildren(javax.faces.context.FacesContext context,
                            javax.faces.component.UIComponent component)
                              throws java.io.IOException

      Overrides:
        `encodeChildren` in class `AbstractRowsRenderer`
      Throws:
        `java.io.IOException`

    - #### encodeTBodyAjax

          public void encodeTBodyAjax(javax.faces.context.FacesContext context,
                             UIDataTable table)
                               throws java.io.IOException

      Helper method for rendering data table tBody only. For HTML consistency it wrap tBody with extra fake "table" tag
      Parameters:
        `context` -
        `table` -
      Throws:
        `java.io.IOException`

    - #### renderBodyOnly

          public boolean renderBodyOnly(javax.faces.context.FacesContext context,
                               UIDataTable table)

      Check whether to render tbody only by Ajax call
      Parameters:
        `context` -
        `table` -
      Returns:
        data table tBody only should be rendered

    - #### encodeTableStructure

          public void encodeTableStructure(javax.faces.context.FacesContext context,
                                  UIDataTable table)
                                    throws java.io.IOException

      Encode all table structure - colgroups definitions, caption, header, footer
      Parameters:
        `context` -
        `table` -
      Throws:
        `java.io.IOException`

    - #### encodeHeader

          public void encodeHeader(javax.faces.context.FacesContext context,
                          UIDataTable table,
                          int numberOfColumns)
                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### isColumnFacetPresent

          public boolean isColumnFacetPresent(UIDataTable table,
                                     java.lang.String facetName)

    - #### isHeaderFactoryColumnAttributePresent

          public boolean isHeaderFactoryColumnAttributePresent(UIDataTable table,
                                                      java.lang.String attributeName)

      Returns true if specified attribute (when present on the column) should generate header even if it is not specified on the table
      Parameters:
        `table` - - rendered UIDataTable
        `attributeName` - - attribute name
      Returns:
        true if specified attribute should generate header on the table

    - #### isColumnRendered

          protected boolean isColumnRendered(javax.faces.component.UIComponent component)

      Parameters:
        `component` -
      Returns:

    - #### encodeHeaderFacets

          protected void encodeHeaderFacets(javax.faces.context.FacesContext context,
                                javax.faces.context.ResponseWriter writer,
                                java.util.Iterator<javax.faces.component.UIComponent> headers,
                                java.lang.String skinCellClass,
                                java.lang.String headerClass,
                                java.lang.String facetName,
                                java.lang.String element,
                                int colCount)
                                     throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### encodeFooter

          public void encodeFooter(javax.faces.context.FacesContext context,
                          UIDataTable table,
                          int columns)
                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### encodeOneRow

          public void encodeOneRow(javax.faces.context.FacesContext context,
                          TableHolder holder)
                            throws java.io.IOException

      Specified by:
        `encodeOneRow` in class `AbstractRowsRenderer`
      Throws:
        `java.io.IOException`

    - #### encodeRowStart

          protected void encodeRowStart(javax.faces.context.FacesContext context,
                            java.lang.String rowClass,
                            UIDataTable table,
                            javax.faces.context.ResponseWriter writer)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getRowSkinClass

          protected java.lang.String getRowSkinClass()

      Returns:

    - #### getFirstRowSkinClass

          protected java.lang.String getFirstRowSkinClass()

      Returns:

    - #### getCellSkinClass

          protected java.lang.String getCellSkinClass()

      Returns:

    - #### encodeRowStart

          protected void encodeRowStart(javax.faces.context.FacesContext context,
                            java.lang.String skinClass,
                            java.lang.String rowClass,
                            UIDataTable table,
                            javax.faces.context.ResponseWriter writer)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getColumnsCount

          protected int getColumnsCount(UIDataTable table)

      Calculate total number of columns in table.
      Parameters:
        `context` -
        `table` -
      Returns:

    - #### calculateRowColumns

          protected int calculateRowColumns(java.util.Iterator<javax.faces.component.UIComponent> col)

      Calculate max number of columns per row. For rows, recursive calculate max length.
      Parameters:
        `col` - - Iterator other all columns in table.
      Returns:

    - #### doDecode

          protected void doDecode(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component)

      Overrides:
        `doDecode` in class `org.ajax4jsf.renderkit.RendererBase`

    - #### encodeEnd

          public void encodeEnd(javax.faces.context.FacesContext context,
                       javax.faces.component.UIComponent component)
                         throws java.io.IOException

      Overrides:
        `encodeEnd` in class `org.ajax4jsf.renderkit.RendererBase`
      Throws:
        `java.io.IOException`

    - #### addInplaceInput

          protected void addInplaceInput(javax.faces.context.FacesContext context,
                             javax.faces.component.UIComponent column,
                             java.lang.String buffer)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### buildAjaxFunction

          protected java.lang.String buildAjaxFunction(javax.faces.context.FacesContext context,
                                           javax.faces.component.UIComponent column,
                                           boolean sortable)

    - #### setRequiresScripts

          protected void setRequiresScripts(javax.faces.context.FacesContext context)

    - #### isRequiresScripts

          protected boolean isRequiresScripts(javax.faces.context.FacesContext context)

    - #### getScripts

          protected org.ajax4jsf.resource.InternetResource[] getScripts()

      Overrides:
        `getScripts` in class `org.ajax4jsf.renderkit.HeaderResourcesRendererBase`

    - #### encodeRowEvents

          protected void encodeRowEvents(javax.faces.context.FacesContext context,
                             org.ajax4jsf.component.UIDataAdaptor table)
                                  throws java.io.IOException

      Overrides:
        `encodeRowEvents` in class `AbstractRowsRenderer`
      Throws:
        `java.io.IOException`

Copyright © 2014. All Rights Reserved.