Top Description Inners Fields Constructors Methods
com.sun.faces.renderkit.html_basic

public abstract Class BaseTableRenderer

extends HtmlBasicRenderer
Class Inheritance
Known Direct Subclasses
com.sun.faces.renderkit.html_basic.GridRenderer, com.sun.faces.renderkit.html_basic.TableRenderer
Imports
java.io.IOException, java.util.ArrayList, .Collections, .List, .Map, com.sun.faces.renderkit.Attribute, .RenderKitUtils, com.sun.faces.util.Util, jakarta.faces.component.UIColumn, .UIComponent, .UIData, jakarta.faces.context.FacesContext, .ResponseWriter

Base class for concrete Grid and Table renderers.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Inherited from com.sun.faces.renderkit.html_basic.HtmlBasicRenderer:
EMPTY_PARAMSlogger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
clearMetaInfo(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table from which the TableMetaInfo will be removed
table
)

Removes the cached TableMetaInfo from the specified component.

protected String

Returns:

a unique key to store the metadata in the request and still have it associated with a specific component.
createKey
(UIComponent
the table that's being rendered
table
)

Creates a unique key based on the provided UIComponent with which the TableMetaInfo can be looked up.

protected BaseTableRenderer.TableMetaInfo

Returns:

the TableMetaInfo for provided table
getMetaInfo
(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
)

Returns a TableMetaInfo object containing details such as row and column classes, columns, and a mechanism for scrolling through the row/column classes.

protected void
renderCaption(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
)

Renders the caption of the table applying the values of captionClass as the class and captionStyle as the style if either are present.

protected abstract void
renderFooter(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
)

Called to render the opening/closing tfoot elements and any content nested between.

protected abstract void
renderHeader(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
)

Called to render the opening/closing thead elements and any content nested between.

protected abstract void
renderRow(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
UIComponent
the current row (if any - an implmenetation may not need this)
row
,
ResponseWriter
the current writer
writer
)

Call to render the content that should be included between opening and closing tr elements.

protected void
renderRowEnd(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
)

Renders the closing rt element.

protected void
renderRowStart(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
)

Renders the starting tr element applying any values from the rowClasses attribute.

protected void
renderTableBodyEnd(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
)

Renders the closing tbody element.

protected void
renderTableBodyStart(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
)

Renders the starting tbody element.

protected void
renderTableEnd(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
)

Renders the closing table element.

protected void
renderTableStart(FacesContext
the FacesContext for the current request
context
,
UIComponent
the table that's being rendered
table
,
ResponseWriter
the current writer
writer
,
Attribute[]
pass-through attributes that the component supports
attributes
)

Renders the start of a table and applies the value of styleClass if available and renders any pass through attributes that may be specified.

Inherited from com.sun.faces.renderkit.html_basic.HtmlBasicRenderer:
augmentIdReferenceconvertClientIddecodedecodeBehaviorsencodeEndencodeRecursivegetBehaviorParametersgetChildrengetCurrentValuegetEndTextToRendergetFacetgetForComponentgetFormattedValuegetFormattedValuegetMessageItergetParamListgetPassThruBehaviorsgetRendersChildrengetValueisBehaviorSourcerendererParamsNotNullsetSubmittedValueshouldDecodeshouldEncodeshouldEncodeChildrenshouldWriteIdAttributewriteIdAttributeIfNecessary

Constructor Detail

BaseTableRendererback to summary
public BaseTableRenderer()

Method Detail

clearMetaInfoback to summary
protected void clearMetaInfo(FacesContext context, UIComponent table)

Removes the cached TableMetaInfo from the specified component.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table from which the TableMetaInfo will be removed

createKeyback to summary
protected String createKey(UIComponent table)

Creates a unique key based on the provided UIComponent with which the TableMetaInfo can be looked up.

Parameters
table:UIComponent

the table that's being rendered

Returns:String

a unique key to store the metadata in the request and still have it associated with a specific component.

getMetaInfoback to summary
protected BaseTableRenderer.TableMetaInfo getMetaInfo(FacesContext context, UIComponent table)

Returns a TableMetaInfo object containing details such as row and column classes, columns, and a mechanism for scrolling through the row/column classes.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

Returns:BaseTableRenderer.TableMetaInfo

the TableMetaInfo for provided table

renderCaptionback to summary
protected void renderCaption(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException

Renders the caption of the table applying the values of captionClass as the class and captionStyle as the style if either are present.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

Exceptions
IOException:
if content cannot be written
renderFooterback to summary
protected abstract void renderFooter(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException

Called to render the opening/closing tfoot elements and any content nested between.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

Exceptions
IOException:
if content cannot be written
renderHeaderback to summary
protected abstract void renderHeader(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException

Called to render the opening/closing thead elements and any content nested between.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

Exceptions
IOException:
if content cannot be written
renderRowback to summary
protected abstract void renderRow(FacesContext context, UIComponent table, UIComponent row, ResponseWriter writer) throws IOException

Call to render the content that should be included between opening and closing tr elements.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

row:UIComponent

the current row (if any - an implmenetation may not need this)

writer:ResponseWriter

the current writer

Exceptions
IOException:
if content cannot be written
renderRowEndback to summary
protected void renderRowEnd(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException

Renders the closing rt element.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

Annotations
@SuppressWarnings:UnusedDeclaration
Exceptions
IOException:
if content cannot be written
renderRowStartback to summary
protected void renderRowStart(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException

Renders the starting tr element applying any values from the rowClasses attribute.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

Exceptions
IOException:
if content cannot be written
renderTableBodyEndback to summary
protected void renderTableBodyEnd(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException

Renders the closing tbody element.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

Annotations
@SuppressWarnings:UnusedDeclaration
Exceptions
IOException:
if content cannot be written
renderTableBodyStartback to summary
protected void renderTableBodyStart(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException

Renders the starting tbody element.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

Annotations
@SuppressWarnings:UnusedDeclaration
Exceptions
IOException:
if content cannot be written
renderTableEndback to summary
protected void renderTableEnd(FacesContext context, UIComponent table, ResponseWriter writer) throws IOException

Renders the closing table element.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

Annotations
@SuppressWarnings:UnusedDeclaration
Exceptions
IOException:
if content cannot be written
renderTableStartback to summary
protected void renderTableStart(FacesContext context, UIComponent table, ResponseWriter writer, Attribute[] attributes) throws IOException

Renders the start of a table and applies the value of styleClass if available and renders any pass through attributes that may be specified.

Parameters
context:FacesContext

the FacesContext for the current request

table:UIComponent

the table that's being rendered

writer:ResponseWriter

the current writer

attributes:Attribute[]

pass-through attributes that the component supports

Exceptions
IOException:
if content cannot be written
com.sun.faces.renderkit.html_basic back to summary

protected Class BaseTableRenderer.TableMetaInfo

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.faces.renderkit.html_basic.BaseTableRenderer.TableMetaInfo

Field Summary

Modifier and TypeField and Description
public final String[]
public final int
public final List<UIColumn>
public int
private static final String[]
public final boolean
public final boolean
public static final String
public final String[]
public int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static String[]

Returns:

an array of column classes
getColumnClasses
(UIComponent
jakarta.faces.component.UIComponent component being rendered
table
)

Return an array of stylesheet classes to be applied to each column in the table in the order specified.

private static List<UIColumn>

Returns:

the List of all UIColumn children
getColumns
(UIComponent
the table from which to extract children
table
)

Return an Iterator over the UIColumn children of the specified UIData that have a rendered property of true.

public String

Returns:

the current style
getCurrentColumnClass
()

Obtain the column class based on the current counter.

public String

Returns:

the current style
getCurrentRowClass
()

Obtain the row class based on the current counter.

private static String[]

Returns:

an array of row classes
getRowClasses
(UIComponent
jakarta.faces.component.UIComponent component being rendered
table
)

Return an array of stylesheet classes to be applied to each row in the table, in the order specified.

private static boolean

Returns:

the number of columns associated with the specified Facet name
hasFacet
(String
Name of the facet being analyzed
name
,
List<UIColumn>
the columns to search
columns
)

Return the number of child UIColumn components nested in the specified UIData that have a facet with the specified name.

public void
newRow()

Reset the counter used to apply column styles.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

columnClassesback to summary
public final String[] columnClasses
columnCountback to summary
public final int columnCount
columnsback to summary
public final List<UIColumn> columns
columnStyleCounterback to summary
public int columnStyleCounter
EMPTY_STRING_ARRAYback to summary
private static final String[] EMPTY_STRING_ARRAY
hasFooterFacetsback to summary
public final boolean hasFooterFacets
hasHeaderFacetsback to summary
public final boolean hasHeaderFacets
KEYback to summary
public static final String KEY
rowClassesback to summary
public final String[] rowClasses
rowStyleCounterback to summary
public int rowStyleCounter

Constructor Detail

TableMetaInfoback to summary
public TableMetaInfo(UIComponent table)

Method Detail

getColumnClassesback to summary
private static String[] getColumnClasses(UIComponent table)

Return an array of stylesheet classes to be applied to each column in the table in the order specified. Every column may or may not have a stylesheet.

Parameters
table:UIComponent

jakarta.faces.component.UIComponent component being rendered

Returns:String[]

an array of column classes

getColumnsback to summary
private static List<UIColumn> getColumns(UIComponent table)

Return an Iterator over the UIColumn children of the specified UIData that have a rendered property of true.

Parameters
table:UIComponent

the table from which to extract children

Returns:List<UIColumn>

the List of all UIColumn children

getCurrentColumnClassback to summary
public String getCurrentColumnClass()

Obtain the column class based on the current counter. Calling this method automatically moves the pointer to the next style. If the counter is larger than the number of total classes, the counter will be reset.

Returns:String

the current style

getCurrentRowClassback to summary
public String getCurrentRowClass()

Obtain the row class based on the current counter. Calling this method automatically moves the pointer to the next style. If the counter is larger than the number of total classes, the counter will be reset.

Returns:String

the current style

getRowClassesback to summary
private static String[] getRowClasses(UIComponent table)

Return an array of stylesheet classes to be applied to each row in the table, in the order specified. Every row may or may not have a stylesheet.

Parameters
table:UIComponent

jakarta.faces.component.UIComponent component being rendered

Returns:String[]

an array of row classes

hasFacetback to summary
private static boolean hasFacet(String name, List<UIColumn> columns)

Return the number of child UIColumn components nested in the specified UIData that have a facet with the specified name.

Parameters
name:String

Name of the facet being analyzed

columns:List<UIColumn>

the columns to search

Returns:boolean

the number of columns associated with the specified Facet name

newRowback to summary
public void newRow()

Reset the counter used to apply column styles.