com.sun.webui.jsf.component
Class TableColumn

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.sun.webui.jsf.component.WebuiComponent
              extended by com.sun.webui.jsf.component.TableColumnBase
                  extended by com.sun.webui.jsf.component.TableColumn
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class TableColumn
extends TableColumnBase

Component that represents a table column.

The tableColumn component provides a layout mechanism for displaying columns of data. UI guidelines describe specific behavior that can applied to the rows and columns of data such as sorting, filtering, pagination, selection, and custom user actions. In addition, UI guidelines also define sections of the table that can be used for titles, row group headers, and placement of pre-defined and user defined actions.

Note: Column headers and footers are rendered by TableRowGroupRenderer. Table column footers are rendered by TableRenderer.

Note: To see the messages logged by this class, set the following global defaults in your JDK's "jre/lib/logging.properties" file.

 java.util.logging.ConsoleHandler.level = FINE
 com.sun.web.ui.component.TableColumn.level = FINE
 

See TLD docs for more information.


Field Summary
static java.lang.String COLUMN_FOOTER_FACET
          The facet name for the column footer.
static java.lang.String COLUMN_FOOTER_ID
          The component id for the column footer.
static java.lang.String COLUMN_HEADER_FACET
          The facet name for the column header.
static java.lang.String COLUMN_HEADER_ID
          The component id for the column header.
static java.lang.String EMBEDDED_ACTION_SEPARATOR_ICON_FACET
          The facet name for the embedded action separator icon.
static java.lang.String EMBEDDED_ACTION_SEPARATOR_ICON_ID
          The component id for the embedded action separator icon.
static java.lang.String EMPTY_CELL_ICON_FACET
          The facet name for the empty cell icon.
static java.lang.String EMPTY_CELL_ICON_ID
          The component id for the empty cell icon.
static java.lang.String FOOTER_FACET
          The facet name for the footer area.
static java.lang.String HEADER_FACET
          The facet name for the header area.
static java.lang.String TABLE_COLUMN_FOOTER_FACET
          The facet name for the table column footer.
static java.lang.String TABLE_COLUMN_FOOTER_ID
          The component id for the table column footer.
static java.lang.String TABLE_FOOTER_FACET
          The facet name for the table footer area.
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TableColumn()
          Default constructor
 
Method Summary
 void clear()
          Clear cached properties.
 java.lang.String getAlign()
          Get the horizontal alignment for the cell.
 int getColumnCount()
          Get the number of columns found for this component that have a rendered property of true.
 javax.faces.component.UIComponent getColumnFooter()
          Get column footer.
 javax.faces.component.UIComponent getColumnHeader()
          Get column header.
 javax.faces.component.UIComponent getEmbeddedActionSeparatorIcon()
          Get separator icon for embedded actions.
 javax.faces.component.UIComponent getEmptyCellIcon()
          Get the icon used to display inapplicable or unexpectedly empty cells.
 java.lang.String getExtraFooterHtml()
          Extra HTML code to be appended to the <td> HTML element that is rendered for the column footer.
 java.lang.String getExtraHeaderHtml()
          Extra HTML code to be appended to the <th> HTML element that is rendered for the column header.
 java.lang.String getExtraTableFooterHtml()
          Extra HTML code to be appended to the <td> HTML element that is rendered for the table column footer.
 java.lang.String getFamily()
          Return the family for this component.
 com.sun.data.provider.SortCriteria getSortCriteria()
          Get SortCriteria used for sorting the contents of a TableDataProvider.
 java.lang.String getSortToolTipAugment(boolean descending)
          Get sort tool tip augment based on the value given to the align property of the tableColumn component.
 Table getTableAncestor()
          Get the closest Table ancestor that encloses this component.
 TableColumn getTableColumnAncestor()
          Get the closest TableColumn ancestor that encloses this component.
 javax.faces.component.UIComponent getTableColumnFooter()
          Get table column footer.
 java.lang.String getTableFooterText()
          The text to be displayed in the table column footer.
 TableRowGroup getTableRowGroupAncestor()
          Get the closest TableRowGroup ancestor that encloses this component.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setExtraFooterHtml(java.lang.String extraFooterHtml)
          Extra HTML code to be appended to the <td> HTML element that is rendered for the column footer.
 void setExtraHeaderHtml(java.lang.String extraHeaderHtml)
          Extra HTML code to be appended to the <th> HTML element that is rendered for the column header.
 void setExtraTableFooterHtml(java.lang.String extraTableFooterHtml)
          Extra HTML code to be appended to the <td> HTML element that is rendered for the table column footer.
 void setTableFooterText(java.lang.String tableFooterText)
          The text to be displayed in the table column footer.
 
Methods inherited from class com.sun.webui.jsf.component.TableColumnBase
getAbbr, getAlignKey, getAxis, getBgColor, getChar, getCharOff, getColSpan, getFooterText, getHeaders, getHeaderText, getHeight, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getRowSpan, getScope, getSelectId, getSeverity, getSort, getSortIcon, getSortImageURL, getStyle, getStyleClass, getTableColumnChildren, getToolTip, getValign, getWidth, isDescending, isEmbeddedActions, isEmptyCell, isNoWrap, isRowHeader, isSpacerColumn, isVisible, setAbbr, setAlign, setAlignKey, setAxis, setBgColor, setChar, setCharOff, setColSpan, setDescending, setEmbeddedActions, setEmptyCell, setFooterText, setHeaders, setHeaderText, setHeight, setNoWrap, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setRowHeader, setRowSpan, setScope, setSelectId, setSeverity, setSort, setSortIcon, setSortImageURL, setSpacerColumn, setStyle, setStyleClass, setToolTip, setValign, setVisible, setWidth
 
Methods inherited from class com.sun.webui.jsf.component.WebuiComponent
processDecodes, processUpdates, processValidators, setId, setRendered
 
Methods inherited from class javax.faces.component.UIComponentBase
broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_FOOTER_ID

public static final java.lang.String COLUMN_FOOTER_ID
The component id for the column footer.

See Also:
Constant Field Values

COLUMN_FOOTER_FACET

public static final java.lang.String COLUMN_FOOTER_FACET
The facet name for the column footer.

See Also:
Constant Field Values

COLUMN_HEADER_ID

public static final java.lang.String COLUMN_HEADER_ID
The component id for the column header.

See Also:
Constant Field Values

COLUMN_HEADER_FACET

public static final java.lang.String COLUMN_HEADER_FACET
The facet name for the column header.

See Also:
Constant Field Values

EMBEDDED_ACTION_SEPARATOR_ICON_ID

public static final java.lang.String EMBEDDED_ACTION_SEPARATOR_ICON_ID
The component id for the embedded action separator icon.

See Also:
Constant Field Values

EMBEDDED_ACTION_SEPARATOR_ICON_FACET

public static final java.lang.String EMBEDDED_ACTION_SEPARATOR_ICON_FACET
The facet name for the embedded action separator icon.

See Also:
Constant Field Values

EMPTY_CELL_ICON_ID

public static final java.lang.String EMPTY_CELL_ICON_ID
The component id for the empty cell icon.

See Also:
Constant Field Values

EMPTY_CELL_ICON_FACET

public static final java.lang.String EMPTY_CELL_ICON_FACET
The facet name for the empty cell icon.

See Also:
Constant Field Values

FOOTER_FACET

public static final java.lang.String FOOTER_FACET
The facet name for the footer area.

See Also:
Constant Field Values

HEADER_FACET

public static final java.lang.String HEADER_FACET
The facet name for the header area.

See Also:
Constant Field Values

TABLE_COLUMN_FOOTER_ID

public static final java.lang.String TABLE_COLUMN_FOOTER_ID
The component id for the table column footer.

See Also:
Constant Field Values

TABLE_COLUMN_FOOTER_FACET

public static final java.lang.String TABLE_COLUMN_FOOTER_FACET
The facet name for the table column footer.

See Also:
Constant Field Values

TABLE_FOOTER_FACET

public static final java.lang.String TABLE_FOOTER_FACET
The facet name for the table footer area.

See Also:
Constant Field Values
Constructor Detail

TableColumn

public TableColumn()
Default constructor

Method Detail

getFamily

public java.lang.String getFamily()
Return the family for this component.

Specified by:
getFamily in class javax.faces.component.UIComponent

clear

public void clear()
Clear cached properties.

Note: Properties may have been cached via the apply request values, validate, and update phases and must be re-evaluated during the render response phase (e.g., the underlying DataProvider may have changed). This cannot always be done via encodeBegin because the component's parent may need to obtain updated properties before this component is rendered.

Overrides:
clear in class TableColumnBase

getTableAncestor

public Table getTableAncestor()
Get the closest Table ancestor that encloses this component.

Returns:
The Table ancestor.

getTableColumnAncestor

public TableColumn getTableColumnAncestor()
Get the closest TableColumn ancestor that encloses this component.

Returns:
The TableColumn ancestor.

getColumnCount

public int getColumnCount()
Get the number of columns found for this component that have a rendered property of true.

Returns:
The number of rendered columns.

getTableRowGroupAncestor

public TableRowGroup getTableRowGroupAncestor()
Get the closest TableRowGroup ancestor that encloses this component.

Returns:
The TableRowGroup ancestor.

getAlign

public java.lang.String getAlign()
Get the horizontal alignment for the cell.

Note: If the align property is specified, it is returned as is. However, if the alignKey property is provided, alignment is based on the object type of the data element. For example, Date and Number objects are aligned using "right", Character and String objects are aligned using "left", and Boolean objects are aligned using "center". Note that select columns are aligned using "center" by default.

Overrides:
getAlign in class TableColumnBase
Returns:
The horizontal alignment for the cell. If the align property is null or the object type cannot be determined, "left" is returned by default.

getColumnFooter

public javax.faces.component.UIComponent getColumnFooter()
Get column footer.

Returns:
The column footer.

getColumnHeader

public javax.faces.component.UIComponent getColumnHeader()
Get column header.

Returns:
The column header.

getTableColumnFooter

public javax.faces.component.UIComponent getTableColumnFooter()
Get table column footer.

Returns:
The table column footer.

getEmptyCellIcon

public javax.faces.component.UIComponent getEmptyCellIcon()
Get the icon used to display inapplicable or unexpectedly empty cells.

Note: UI guidelines suggest not to use this for a value that is truly null, such as an empty alarm cell or a comment field which is blank, neither of which should have the dash image. Further, it is recomended not to use the dash image for cells that contain user interface elements such as checkboxes or drop-down lists when these elements are not applicable. Instead, simply do not display the user interface element.

Returns:
The icon used to display empty cells.

getEmbeddedActionSeparatorIcon

public javax.faces.component.UIComponent getEmbeddedActionSeparatorIcon()
Get separator icon for embedded actions.

Returns:
The separator icon for embedded actions.

getSortCriteria

public com.sun.data.provider.SortCriteria getSortCriteria()
Get SortCriteria used for sorting the contents of a TableDataProvider.

Note: If the sortKey attribute resolves to a SortCriteria object, it is returned as is. However, if there is a value binding, and it's not null, a ValueBindingSortCriteria object is created. If there is no value binding, a FieldIdSortCriteria object is created.

Returns:
The SortCriteria used for sorting.

getSortToolTipAugment

public java.lang.String getSortToolTipAugment(boolean descending)
Get sort tool tip augment based on the value given to the align property of the tableColumn component.

Parameters:
descending - Flag indicating descending sort.
Returns:
The sort tool tip augment.

getExtraFooterHtml

public java.lang.String getExtraFooterHtml()
Extra HTML code to be appended to the <td> HTML element that is rendered for the column footer. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


setExtraFooterHtml

public void setExtraFooterHtml(java.lang.String extraFooterHtml)
Extra HTML code to be appended to the <td> HTML element that is rendered for the column footer. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


getExtraHeaderHtml

public java.lang.String getExtraHeaderHtml()
Extra HTML code to be appended to the <th> HTML element that is rendered for the column header. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


setExtraHeaderHtml

public void setExtraHeaderHtml(java.lang.String extraHeaderHtml)
Extra HTML code to be appended to the <th> HTML element that is rendered for the column header. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


getExtraTableFooterHtml

public java.lang.String getExtraTableFooterHtml()
Extra HTML code to be appended to the <td> HTML element that is rendered for the table column footer. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


setExtraTableFooterHtml

public void setExtraTableFooterHtml(java.lang.String extraTableFooterHtml)
Extra HTML code to be appended to the <td> HTML element that is rendered for the table column footer. Use only code that is valid in an HTML <td> element. The code you specify is inserted in the HTML element, and is not checked for validity. For example, you might set this attribute to "nowrap=`nowrap'".


getTableFooterText

public java.lang.String getTableFooterText()
The text to be displayed in the table column footer. The table column footer is displayed once per table, and is especially useful in tables with multiple groups of rows.


setTableFooterText

public void setTableFooterText(java.lang.String tableFooterText)
The text to be displayed in the table column footer. The table column footer is displayed once per table, and is especially useful in tables with multiple groups of rows.


restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)
Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class TableColumnBase

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class TableColumnBase


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.