com.webmethods.caf.faces.data.object
Class FilterableListTableContentProvider

java.lang.Object
  extended by com.webmethods.caf.faces.bean.PageFlowScopeAdapter
      extended by com.webmethods.caf.faces.data.object.ListTableContentProvider
          extended by com.webmethods.caf.faces.data.object.FilterableListTableContentProvider
All Implemented Interfaces:
IPageFlowScopeAdapter, IAddressableTableContentProvider, IContentProvider, IFilterableTableContentProvider, IReorderableTableContentProvider, ISortableTableContentProvider, ITableContentProvider, IUpdateableContentProvider, IUpdateableTableContentProvider, Serializable

public class FilterableListTableContentProvider
extends ListTableContentProvider
implements IFilterableTableContentProvider

Adapts List and Array objects to the IFilterableTableContentProvider interface.

See Also:
Serialized Form

Field Summary
protected  String m_filter
          Filter expression; null by default (indicating no filter).
protected  boolean m_filterable
          True if this table can filter rows; false by default.
protected  ValueBinding m_filterValue
          Value binding used to calculate row filter value.
protected  List m_unfilteredlist
          The original, unfiltered list.
 
Fields inherited from class com.webmethods.caf.faces.data.object.ListTableContentProvider
m_array, m_canTemplateRow, m_index, m_list, m_onCreateRow, m_onDeleteRow, m_rowId, m_rowType, m_sort, m_templateRow, m_var
 
Fields inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
fExpireWithPageFlow
 
Constructor Summary
FilterableListTableContentProvider()
          Default constructor.
FilterableListTableContentProvider(List list)
          Initializes provider with the given list
FilterableListTableContentProvider(List list, String filterValueBinding, String rowVariable)
          Initializes provider with the given list
FilterableListTableContentProvider(Object[] array)
          Initializes provider with the given array of objects
FilterableListTableContentProvider(Object[] array, String filterValueBinding, String rowVariable)
          Initializes provider with the given array of objects
 
Method Summary
protected  void filter()
          Updates m_list to be the filtered version of m_unfilteredlist, using the filter expression specified by m_filter.
 String getFilter()
          Filter expression.
 ValueBinding getRowFilterValueBinding()
          Value-binding which calculates the value to filter for the current row.
 boolean isFilterable()
          True if this provider truely is filterable.
 void setFilter(String filter)
          Filter expression.
 void setFilterable(boolean filterable)
          True if this provider truely is filterable.
 void setList(List list)
          Sets source list object.
 void setRowFilterValueBinding(ValueBinding binding)
          Value-binding which calculates the value to filter for the current row.
 void setRowFilterValueBindingAsString(String binding)
          Value-binding (in string form) which calculates the value to filter for the current row.
protected  void sort()
          (Re-)sorts list according to sort info.
 
Methods inherited from class com.webmethods.caf.faces.data.object.ListTableContentProvider
calculateRowId, calculateRowId, createRow, deleteRow, getArray, getCanTemplateRow, getCurrentRow, getList, getOnCreateRow, getOnDeleteRow, getPropertyKeys, getRowCount, getRowId, getRowIdBinding, getRowIndex, getRowType, getRowVariable, getSort, getType, getValue, hasProperty, isAddressable, isReadOnly, isReorderable, isRowAvailable, isTemplateRow, moveTo, newRow, setArray, setCanTemplateRow, setCurrentRow, setOnCreateRow, setOnDeleteRow, setRowById, setRowId, setRowIdBinding, setRowIndex, setRowType, setRowVariable, setSort, setTemplateRow, setValue, toString
 
Methods inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter
getExpireWithPageFlow, setExpireWithPageFlow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.webmethods.caf.faces.data.ITableContentProvider
getCurrentRow, getRowCount, getRowIndex, getRowVariable, isRowAvailable, setRowIndex, setRowVariable
 
Methods inherited from interface com.webmethods.caf.faces.data.IContentProvider
getPropertyKeys, getType, getValue, hasProperty, toString
 

Field Detail

m_unfilteredlist

protected List m_unfilteredlist
The original, unfiltered list.


m_filterable

protected boolean m_filterable
True if this table can filter rows; false by default.


m_filter

protected String m_filter
Filter expression; null by default (indicating no filter).


m_filterValue

protected ValueBinding m_filterValue
Value binding used to calculate row filter value.

Constructor Detail

FilterableListTableContentProvider

public FilterableListTableContentProvider()

Default constructor.

FilterableListTableContentProvider.setList(List) or ListTableContentProvider.setArray(Object[]) property must be set before use.


FilterableListTableContentProvider

public FilterableListTableContentProvider(List list)
Initializes provider with the given list

Parameters:
list - list of objects

FilterableListTableContentProvider

public FilterableListTableContentProvider(Object[] array)
Initializes provider with the given array of objects

Parameters:
array - array of objects

FilterableListTableContentProvider

public FilterableListTableContentProvider(List list,
                                          String filterValueBinding,
                                          String rowVariable)
Initializes provider with the given list

Parameters:
list - list of objects

FilterableListTableContentProvider

public FilterableListTableContentProvider(Object[] array,
                                          String filterValueBinding,
                                          String rowVariable)
Initializes provider with the given array of objects

Parameters:
array - array of objects
Method Detail

isFilterable

public boolean isFilterable()
Description copied from interface: IFilterableTableContentProvider
True if this provider truely is filterable.

Specified by:
isFilterable in interface IFilterableTableContentProvider

getFilter

public String getFilter()
Description copied from interface: IFilterableTableContentProvider
Filter expression. Only rows matched by this filter should be exposed. Null or empty ("") signals expose the default set of rows.

Specified by:
getFilter in interface IFilterableTableContentProvider

setFilter

public void setFilter(String filter)
Description copied from interface: IFilterableTableContentProvider
Filter expression. Only rows matched by this filter should be exposed. Null or empty ("") signals expose the default set of rows.

Specified by:
setFilter in interface IFilterableTableContentProvider

sort

protected void sort()
Description copied from class: ListTableContentProvider
(Re-)sorts list according to sort info.

Overrides:
sort in class ListTableContentProvider
See Also:
ListTableContentProvider.setSort(ISortInfo)

setList

public void setList(List list)
Description copied from class: ListTableContentProvider
Sets source list object. Reset row index to -1.

Overrides:
setList in class ListTableContentProvider
Parameters:
list - the list

setFilterable

public void setFilterable(boolean filterable)
True if this provider truely is filterable.


getRowFilterValueBinding

public ValueBinding getRowFilterValueBinding()
Value-binding which calculates the value to filter for the current row.


setRowFilterValueBinding

public void setRowFilterValueBinding(ValueBinding binding)
Value-binding which calculates the value to filter for the current row.


setRowFilterValueBindingAsString

public void setRowFilterValueBindingAsString(String binding)
Value-binding (in string form) which calculates the value to filter for the current row.


filter

protected void filter()
Updates m_list to be the filtered version of m_unfilteredlist, using the filter expression specified by m_filter.