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

java.lang.Object
  extended by SelectItem
      extended by com.webmethods.caf.faces.data.object.BoundPropertiesSelectItemGroupProvider
All Implemented Interfaces:
ISelectItemGroupProvider, ISelectItemProvider, Serializable

public class BoundPropertiesSelectItemGroupProvider
extends SelectItem
implements Serializable, ISelectItemGroupProvider

Adapts a ITableContentProvider, List or array to an ISelectItemGroupProvider.

A binding expression for either the label or value must be defined. If only one of the is defined, it will be used for both label and value.

the the same It value field name is not defined, label field value is used for the select item value.

The following demonstrates creating a new instance of this class, initialized with an array of MyItem objects, with the value of the group's items bound to the myValue property, and the label of the group's items bound to the myLabel property:

 class MyItem {
     public int getMyValue();
     public String getMyLabel(); 
 };
 
 MyItem[] items = new MyItems[] {....};
 ISelectItemGroupProvider provider = new BoundPropertiesSelectItemGroupProvider(items, "item", "#{item.myValue}", "#{item.myLabel}");
 Collection selectItems = provider.getSelectItemContentProviders();
                 
 for (java.util.Iterator i = selectItems(); i.hasNext(); ) {
     ISelectItemProvider selectItem = (ISelectItemProvider) i.next();
           String label = selectItem.getLabel(); // returns value of "myLabel" property for each item
           Object value = selectItem.getValue(); // returns value of "myValue" property for each item
 }
 


Nested Class Summary
protected  class BoundPropertiesSelectItemGroupProvider.SelectItem
           
protected  class BoundPropertiesSelectItemGroupProvider.SelectItemCollection
           
protected  class BoundPropertiesSelectItemGroupProvider.SelectItemIterator
           
protected  class BoundPropertiesSelectItemGroupProvider.SortedSelectItemIterator
           
 
Field Summary
protected  Object[] m_array
           
protected  boolean m_ascending
           
protected  ValueBinding m_description
           
protected  ValueBinding m_disabled
           
protected  ValueBinding m_escape
           
protected  ValueBinding m_icon
           
protected  ValueBinding m_label
           
protected  List m_list
           
protected  ValueBinding m_sort
           
protected  ValueBinding m_style
           
protected  ITableContentProvider m_table
           
protected  ValueBinding m_value
           
protected  String m_var
           
 
Constructor Summary
BoundPropertiesSelectItemGroupProvider()
          Creates new uninitialized provider.
BoundPropertiesSelectItemGroupProvider(ITableContentProvider table, String rowVariable, String valueBindingExpression)
          Creates a new provider to provide select-items from the specified table, with the select-item's value derived from the specified binding expressions.
BoundPropertiesSelectItemGroupProvider(ITableContentProvider table, String rowVariable, String valueBindingExpression, String labelBindingExpression)
          Creates a new provider to provide select-items from the specified table, with the select-item's value and label derived from the specified binding expressions.
BoundPropertiesSelectItemGroupProvider(ITableContentProvider table, String rowVariable, String valueBindingExpression, String labelBindingExpression, String descriptionBindingExpression, String disabledBindingExpression, String styleBindingExpression, String iconBindingExpression)
          Creates a new provider to provide select-items from the specified table, with the select-item's value, label, description, disabled state, css style, and icon derived from the specified binding expressions.
BoundPropertiesSelectItemGroupProvider(List list, String rowVariable, String valueBindingExpression)
          Creates a new provider to provide select-items from the specified list, with the select-item's value derived from the specified binding expressions.
BoundPropertiesSelectItemGroupProvider(List list, String rowVariable, String valueBindingExpression, String labelBindingExpression)
          Creates a new provider to provide select-items from the specified list, with the select-item's value and label derived from the specified binding expressions.
BoundPropertiesSelectItemGroupProvider(List list, String rowVariable, String valueBindingExpression, String labelBindingExpression, String descriptionBindingExpression, String disabledBindingExpression, String styleBindingExpression, String iconBindingExpression)
          Creates a new provider to provide select-items from the specified list, with the select-item's value, label, description, disabled state, css style, and icon derived from the specified binding expressions.
BoundPropertiesSelectItemGroupProvider(Object[] array, String rowVariable, String valueBindingExpression)
          Creates a new provider to provide select-items from the specified array, with the select-item's value derived from the specified binding expressions.
BoundPropertiesSelectItemGroupProvider(Object[] array, String rowVariable, String valueBindingExpression, String labelBindingExpression)
          Creates a new provider to provide select-items from the specified array, with the select-item's value and label derived from the specified binding expressions.
BoundPropertiesSelectItemGroupProvider(Object[] array, String rowVariable, String valueBindingExpression, String labelBindingExpression, String descriptionBindingExpression, String disabledBindingExpression, String styleBindingExpression, String iconBindingExpression)
          Creates a new provider to provide select-items from the specified array, with the select-item's value, label, description, disabled state, css style, and icon derived from the specified binding expressions.
 
Method Summary
 Object[] getArray()
           
 String getDescription()
          Always return null.
 ValueBinding getDescriptionBinding()
           
 ValueBinding getDisabledBinding()
           
 ValueBinding getEscapeBinding()
           
 String getIcon()
          Always return null.
 ValueBinding getIconBinding()
           
 String getLabel()
          Always return null.
 ValueBinding getLabelBinding()
           
 List getList()
           
 String getRowVariable()
           
 Collection getSelectItemContentProviders()
          Returns a collection of ISelectItemProviders.
 ValueBinding getSort()
           
 String getStyle()
          Always return null.
 ValueBinding getStyleBinding()
           
 ITableContentProvider getTable()
           
 Object getValue()
          Always return null.
 ValueBinding getValueBinding()
           
 boolean isAscending()
           
 boolean isDisabled()
          Always return false.
 void setArray(Object[] array)
           
 void setAscending(boolean ascending)
           
 void setDescriptionBinding(ValueBinding b)
           
 void setDisabledBinding(ValueBinding b)
           
 void setEscapeBinding(ValueBinding b)
           
 void setIconBinding(ValueBinding b)
           
 void setLabelBinding(ValueBinding b)
           
 void setList(List list)
           
 void setRowVariable(String var)
           
 void setSort(ValueBinding sort)
           
 void setStyleBinding(ValueBinding b)
           
 void setTable(ITableContentProvider table)
           
 void setValueBinding(ValueBinding b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.webmethods.caf.faces.data.ISelectItemProvider
isEscape
 

Field Detail

m_table

protected ITableContentProvider m_table

m_list

protected List m_list

m_array

protected Object[] m_array

m_description

protected ValueBinding m_description

m_disabled

protected ValueBinding m_disabled

m_icon

protected ValueBinding m_icon

m_label

protected ValueBinding m_label

m_style

protected ValueBinding m_style

m_value

protected ValueBinding m_value

m_escape

protected ValueBinding m_escape

m_var

protected String m_var

m_sort

protected ValueBinding m_sort

m_ascending

protected boolean m_ascending
Constructor Detail

BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider()
Creates new uninitialized provider. Must be initialized with at least a row variable; either a table, list, or array; and a value binding-expression.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(ITableContentProvider table,
                                              String rowVariable,
                                              String valueBindingExpression)
Creates a new provider to provide select-items from the specified table, with the select-item's value derived from the specified binding expressions.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(ITableContentProvider table,
                                              String rowVariable,
                                              String valueBindingExpression,
                                              String labelBindingExpression)
Creates a new provider to provide select-items from the specified table, with the select-item's value and label derived from the specified binding expressions.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(ITableContentProvider table,
                                              String rowVariable,
                                              String valueBindingExpression,
                                              String labelBindingExpression,
                                              String descriptionBindingExpression,
                                              String disabledBindingExpression,
                                              String styleBindingExpression,
                                              String iconBindingExpression)
Creates a new provider to provide select-items from the specified table, with the select-item's value, label, description, disabled state, css style, and icon derived from the specified binding expressions. All binding expressions except value may be null.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(List list,
                                              String rowVariable,
                                              String valueBindingExpression)
Creates a new provider to provide select-items from the specified list, with the select-item's value derived from the specified binding expressions.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(List list,
                                              String rowVariable,
                                              String valueBindingExpression,
                                              String labelBindingExpression)
Creates a new provider to provide select-items from the specified list, with the select-item's value and label derived from the specified binding expressions.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(List list,
                                              String rowVariable,
                                              String valueBindingExpression,
                                              String labelBindingExpression,
                                              String descriptionBindingExpression,
                                              String disabledBindingExpression,
                                              String styleBindingExpression,
                                              String iconBindingExpression)
Creates a new provider to provide select-items from the specified list, with the select-item's value, label, description, disabled state, css style, and icon derived from the specified binding expressions. All binding expressions except value may be null.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(Object[] array,
                                              String rowVariable,
                                              String valueBindingExpression)
Creates a new provider to provide select-items from the specified array, with the select-item's value derived from the specified binding expressions.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(Object[] array,
                                              String rowVariable,
                                              String valueBindingExpression,
                                              String labelBindingExpression)
Creates a new provider to provide select-items from the specified array, with the select-item's value and label derived from the specified binding expressions.


BoundPropertiesSelectItemGroupProvider

public BoundPropertiesSelectItemGroupProvider(Object[] array,
                                              String rowVariable,
                                              String valueBindingExpression,
                                              String labelBindingExpression,
                                              String descriptionBindingExpression,
                                              String disabledBindingExpression,
                                              String styleBindingExpression,
                                              String iconBindingExpression)
Creates a new provider to provide select-items from the specified array, with the select-item's value, label, description, disabled state, css style, and icon derived from the specified binding expressions. All binding expressions except value may be null.

Method Detail

getSelectItemContentProviders

public Collection getSelectItemContentProviders()
Description copied from interface: ISelectItemGroupProvider
Returns a collection of ISelectItemProviders.

Specified by:
getSelectItemContentProviders in interface ISelectItemGroupProvider
Returns:
collectio of individual select items

getDescription

public String getDescription()
Always return null.

Specified by:
getDescription in interface ISelectItemProvider
Returns:
item's description

getIcon

public String getIcon()
Always return null.

Specified by:
getIcon in interface ISelectItemProvider
Returns:
icon url

getLabel

public String getLabel()
Always return null.

Specified by:
getLabel in interface ISelectItemProvider
Returns:
item's label

getStyle

public String getStyle()
Always return null.

Specified by:
getStyle in interface ISelectItemProvider
Returns:
items's CSS style

getValue

public Object getValue()
Always return null.

Specified by:
getValue in interface ISelectItemProvider
Returns:
item's value

isDisabled

public boolean isDisabled()
Always return false.

Specified by:
isDisabled in interface ISelectItemProvider
Returns:
disabled status

getArray

public Object[] getArray()

setArray

public void setArray(Object[] array)

isAscending

public boolean isAscending()

setAscending

public void setAscending(boolean ascending)

getList

public List getList()

setList

public void setList(List list)

getSort

public ValueBinding getSort()

setSort

public void setSort(ValueBinding sort)

getTable

public ITableContentProvider getTable()

setTable

public void setTable(ITableContentProvider table)

getRowVariable

public String getRowVariable()

setRowVariable

public void setRowVariable(String var)

getDescriptionBinding

public ValueBinding getDescriptionBinding()

setDescriptionBinding

public void setDescriptionBinding(ValueBinding b)

getDisabledBinding

public ValueBinding getDisabledBinding()

setDisabledBinding

public void setDisabledBinding(ValueBinding b)

getIconBinding

public ValueBinding getIconBinding()

setIconBinding

public void setIconBinding(ValueBinding b)

getLabelBinding

public ValueBinding getLabelBinding()

setLabelBinding

public void setLabelBinding(ValueBinding b)

getStyleBinding

public ValueBinding getStyleBinding()

setStyleBinding

public void setStyleBinding(ValueBinding b)

getValueBinding

public ValueBinding getValueBinding()

setValueBinding

public void setValueBinding(ValueBinding b)

getEscapeBinding

public ValueBinding getEscapeBinding()

setEscapeBinding

public void setEscapeBinding(ValueBinding b)