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

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.SelectableListTableContentProvider
              extended by com.webmethods.caf.faces.data.object.FilterableSelectableListTableContentProvider
All Implemented Interfaces:
IPageFlowScopeAdapter, IAddressableTableContentProvider, IContentProvider, IFilterableTableContentProvider, IRefreshable, IRefreshableContentProvider, IReorderableTableContentProvider, ISelectableTableContentProvider, ISortableTableContentProvider, ITableContentProvider, IUpdateableContentProvider, IUpdateableTableContentProvider, Serializable
Direct Known Subclasses:
NodeTreeContentProvider

public class FilterableSelectableListTableContentProvider
extends SelectableListTableContentProvider
implements IFilterableTableContentProvider

Adapts List and Array objects to the IFilterableTableContentProvider the and ISelectableTableContentProvider interfaces.

See Also:
Serialized Form

Nested Class Summary
protected static class FilterableSelectableListTableContentProvider.RowFilterableValueDecorator
          Filter value decorator for wrapped table rows, using a binding expression to calculate the value.
 
Nested classes/interfaces inherited from class com.webmethods.caf.faces.data.object.SelectableListTableContentProvider
SelectableListTableContentProvider.Row, SelectableListTableContentProvider.RowComparator
 
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; true 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.SelectableListTableContentProvider
m_autoIdCounter, m_map, m_originalList, m_selectableHelper
 
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
FilterableSelectableListTableContentProvider()
          Default constructor.
FilterableSelectableListTableContentProvider(List list)
          Constructor.
FilterableSelectableListTableContentProvider(List list, String rowIdBinding, String filterValueBinding, String rowVariable)
          Fully initialized constructor.
FilterableSelectableListTableContentProvider(Object[] array)
          Constructor.
FilterableSelectableListTableContentProvider(Object[] array, String rowIdBinding, String filterValueBinding, String rowVariable)
          Fully initialized constructor.
 
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.
 String getRowFilterValueBindingAsString()
           
 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 a list to wrap
 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.SelectableListTableContentProvider
createRow, deleteRow, getCurrentRow, getList, getNeedRefresh, getRowId, getRowSelectedCount, getRowSelectedIds, getRowUnselectedIds, getSelectedRows, getUseUnselectedModel, isAddressable, isAutoRefresh, isRowSelected, moveTo, refresh, setAutoRefresh, setCurrentRow, setNeedRefresh, setRowById, setRowSelected, setRowSelectedIds, setRowUnselectedIds, setRowVariable, setTemplateRow, supportsAutoRefresh, updateOriginalList
 
Methods inherited from class com.webmethods.caf.faces.data.object.ListTableContentProvider
calculateRowId, calculateRowId, getArray, getCanTemplateRow, getOnCreateRow, getOnDeleteRow, getPropertyKeys, getRowCount, getRowIdBinding, getRowIndex, getRowType, getRowVariable, getSort, getType, getValue, hasProperty, isReadOnly, isReorderable, isRowAvailable, isTemplateRow, newRow, setArray, setCanTemplateRow, setOnCreateRow, setOnDeleteRow, setRowId, setRowIdBinding, setRowIndex, setRowType, setSort, 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; true 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

FilterableSelectableListTableContentProvider

public FilterableSelectableListTableContentProvider()
Default constructor. Requires FilterableSelectableListTableContentProvider.setList(List) or ListTableContentProvider.setArray(Object[]), ListTableContentProvider.setRowIdBinding(ValueBinding) and SelectableListTableContentProvider.setRowVariable(String) to be set before use.


FilterableSelectableListTableContentProvider

public FilterableSelectableListTableContentProvider(List list)
Constructor. Requires ListTableContentProvider.setRowIdBinding(ValueBinding) and SelectableListTableContentProvider.setRowVariable(String) to be set before use.

Parameters:
list - a list to wrap

FilterableSelectableListTableContentProvider

public FilterableSelectableListTableContentProvider(List list,
                                                    String rowIdBinding,
                                                    String filterValueBinding,
                                                    String rowVariable)
Fully initialized constructor.

Parameters:
list - a list to wrap
rowIdBinding - row id binding expression
filterValueBinding - Value-binding which calculates the value to filter for the current row.
rowVariable - row variable to use in the expression for accessing list elements data

FilterableSelectableListTableContentProvider

public FilterableSelectableListTableContentProvider(Object[] array)
Constructor. Requires ListTableContentProvider.setRowIdBinding(ValueBinding) and SelectableListTableContentProvider.setRowVariable(String) to be set before use.

Parameters:
array - an array to wrap

FilterableSelectableListTableContentProvider

public FilterableSelectableListTableContentProvider(Object[] array,
                                                    String rowIdBinding,
                                                    String filterValueBinding,
                                                    String rowVariable)
Fully initialized constructor.

Parameters:
array - an array to wrap
rowIdBinding - row id binding expression
filterValueBinding - Value-binding which calculates the value to filter for the current row.
rowVariable - row variable to use in the expression for accessing list elements data
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 SelectableListTableContentProvider
See Also:
ListTableContentProvider.setSort(ISortInfo)

setList

public void setList(List list)
Description copied from class: SelectableListTableContentProvider
Sets a list to wrap

Overrides:
setList in class SelectableListTableContentProvider
Parameters:
list - a 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.


getRowFilterValueBindingAsString

public String getRowFilterValueBindingAsString()

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.