org.apache.myfaces.trinidad.component
Class TableUtils

java.lang.Object
  extended by org.apache.myfaces.trinidad.component.TableUtils

public final class TableUtils
extends Object

utility methods for dealing with tables.


Method Summary
static SortStrength findSortStrength(UIXCollection parent, String sortProperty)
          Retrieves the sort strength for the column with the given sort property from the given table.
static int getLast(CollectionComponent table)
          Gets the index of the last visible row that should be displayed by the given table.
static int getLast(CollectionComponent table, int rangeStart)
          Gets the index of the last visible row that should be displayed by the given table.
static void processColumnFacets(javax.faces.context.FacesContext context, UIXCollection table, javax.faces.component.UIComponent column, javax.faces.event.PhaseId phaseId)
          Process all the facets of any children that are columns; these are generally not processed once per row.
static void processFacets(javax.faces.context.FacesContext context, UIXCollection table, javax.faces.component.UIComponent component, javax.faces.event.PhaseId phaseId, String skipFacet)
          Process all the facets of a component; these are generally not processed once per row.
static void processStampedChildren(javax.faces.context.FacesContext context, UIXCollection table, javax.faces.event.PhaseId phaseId)
          Process all the children of the given table
static Object setupELVariable(javax.faces.context.FacesContext context, String name, Object value)
          Sets up an EL variable on the requestScope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLast

public static int getLast(CollectionComponent table)
Gets the index of the last visible row that should be displayed by the given table. This is usually CollectionComponent.getFirst() added to CollectionComponent.getRows() minus 1, but it changes if RowKeyIndex.getRowCount() returns insufficient rows.

Returns:
if this table is empty, this returns CollectionComponent.getFirst() - 1

getLast

public static int getLast(CollectionComponent table,
                          int rangeStart)
Gets the index of the last visible row that should be displayed by the given table. This is usually rangeStart added to CollectionComponent.getRows() minus 1, but it changes if RowKeyIndex.getRowCount() returns insufficient rows.

Returns:
if this table is empty, this returns rangeStart - 1

setupELVariable

public static Object setupELVariable(javax.faces.context.FacesContext context,
                                     String name,
                                     Object value)
Sets up an EL variable on the requestScope.

Parameters:
name - The name of the EL variable
value - The value of the EL variable
Returns:
any old value that was bound to the EL variable, or null if there was no old value.

processFacets

public static void processFacets(javax.faces.context.FacesContext context,
                                 UIXCollection table,
                                 javax.faces.component.UIComponent component,
                                 javax.faces.event.PhaseId phaseId,
                                 String skipFacet)
Process all the facets of a component; these are generally not processed once per row.

Parameters:
skipFacet - the name of any facet that should not be processed at this time.

processColumnFacets

public static void processColumnFacets(javax.faces.context.FacesContext context,
                                       UIXCollection table,
                                       javax.faces.component.UIComponent column,
                                       javax.faces.event.PhaseId phaseId)
Process all the facets of any children that are columns; these are generally not processed once per row.


processStampedChildren

public static void processStampedChildren(javax.faces.context.FacesContext context,
                                          UIXCollection table,
                                          javax.faces.event.PhaseId phaseId)
Process all the children of the given table


findSortStrength

public static SortStrength findSortStrength(UIXCollection parent,
                                            String sortProperty)
Retrieves the sort strength for the column with the given sort property from the given table.

Parameters:
parent - the Collection object whose columns are searched for matching sortProperty and retrieving sort strength from.
sortProperty - sort property value to match against column's sortProperty property.
Returns:
sort strength for the column with the given sort property from the given table.


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.