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 }
Modifier and Type | Class and Description |
---|---|
protected class |
BoundPropertiesSelectItemGroupProvider.SelectItem |
protected class |
BoundPropertiesSelectItemGroupProvider.SelectItemCollection |
protected class |
BoundPropertiesSelectItemGroupProvider.SelectItemIterator |
protected class |
BoundPropertiesSelectItemGroupProvider.SortedSelectItemIterator |
Modifier and Type | Field and Description |
---|---|
protected Object[] |
m_array |
protected boolean |
m_ascending |
protected ValueExpression |
m_description |
protected ValueExpression |
m_disabled |
protected ValueExpression |
m_escape |
protected ValueExpression |
m_icon |
protected ValueExpression |
m_label |
protected List<Object> |
m_list |
protected ValueExpression |
m_sort |
protected ValueExpression |
m_style |
protected ITableContentProvider |
m_table |
protected ValueExpression |
m_value |
protected String |
m_var |
Constructor and Description |
---|
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.
|
isEscape, isNoSelectionOption, setDescription, setDisabled, setEscape, setLabel, setNoSelectionOption, setValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isEscape
protected ITableContentProvider m_table
protected Object[] m_array
protected ValueExpression m_description
protected ValueExpression m_disabled
protected ValueExpression m_icon
protected ValueExpression m_label
protected ValueExpression m_style
protected ValueExpression m_value
protected ValueExpression m_escape
protected String m_var
protected ValueExpression m_sort
protected boolean m_ascending
public BoundPropertiesSelectItemGroupProvider()
public BoundPropertiesSelectItemGroupProvider(ITableContentProvider table, String rowVariable, String valueBindingExpression)
public BoundPropertiesSelectItemGroupProvider(ITableContentProvider table, String rowVariable, String valueBindingExpression, String labelBindingExpression)
public BoundPropertiesSelectItemGroupProvider(ITableContentProvider table, String rowVariable, String valueBindingExpression, String labelBindingExpression, String descriptionBindingExpression, String disabledBindingExpression, String styleBindingExpression, String iconBindingExpression)
public BoundPropertiesSelectItemGroupProvider(List<?> list, String rowVariable, String valueBindingExpression)
public BoundPropertiesSelectItemGroupProvider(List<?> list, String rowVariable, String valueBindingExpression, String labelBindingExpression)
public BoundPropertiesSelectItemGroupProvider(List<?> list, String rowVariable, String valueBindingExpression, String labelBindingExpression, String descriptionBindingExpression, String disabledBindingExpression, String styleBindingExpression, String iconBindingExpression)
public BoundPropertiesSelectItemGroupProvider(Object[] array, String rowVariable, String valueBindingExpression)
public BoundPropertiesSelectItemGroupProvider(Object[] array, String rowVariable, String valueBindingExpression, String labelBindingExpression)
public BoundPropertiesSelectItemGroupProvider(Object[] array, String rowVariable, String valueBindingExpression, String labelBindingExpression, String descriptionBindingExpression, String disabledBindingExpression, String styleBindingExpression, String iconBindingExpression)
public Collection<ISelectItemProvider> getSelectItemContentProviders()
ISelectItemGroupProvider
ISelectItemProvider
s.getSelectItemContentProviders
in interface ISelectItemGroupProvider
public String getDescription()
getDescription
in interface ISelectItemProvider
getDescription
in class SelectItem
public String getIcon()
getIcon
in interface ISelectItemProvider
public String getLabel()
getLabel
in interface ISelectItemProvider
getLabel
in class SelectItem
public String getStyle()
getStyle
in interface ISelectItemProvider
public Object getValue()
getValue
in interface ISelectItemProvider
getValue
in class SelectItem
public boolean isDisabled()
isDisabled
in interface ISelectItemProvider
isDisabled
in class SelectItem
public Object[] getArray()
public void setArray(Object[] array)
public boolean isAscending()
public void setAscending(boolean ascending)
public void setList(List<?> list)
@Deprecated public ValueBinding getSort()
setSortExpression(ValueExpression)
instead@Deprecated public void setSort(ValueBinding sort)
setSortExpression(ValueExpression)
insteadpublic ValueExpression getSortExpression()
public void setSortExpression(ValueExpression sort)
public ITableContentProvider getTable()
public void setTable(ITableContentProvider table)
public String getRowVariable()
public void setRowVariable(String var)
@Deprecated public ValueBinding getDescriptionBinding()
getDescriptionExpression()
instead@Deprecated public void setDescriptionBinding(ValueBinding b)
setDescriptionExpression(ValueExpression)
insteadpublic ValueExpression getDescriptionExpression()
public void setDescriptionExpression(ValueExpression b)
@Deprecated public ValueBinding getDisabledBinding()
getDisabledExpression()
instead@Deprecated public void setDisabledBinding(ValueBinding b)
setDisabledExpression(ValueExpression)
insteadpublic ValueExpression getDisabledExpression()
public void setDisabledExpression(ValueExpression b)
@Deprecated public ValueBinding getIconBinding()
getIconExpression()
instead@Deprecated public void setIconBinding(ValueBinding b)
setIconExpression(ValueExpression)
insteadpublic ValueExpression getIconExpression()
public void setIconExpression(ValueExpression b)
@Deprecated public ValueBinding getLabelBinding()
getLabelExpression()
instead@Deprecated public void setLabelBinding(ValueBinding b)
setLabelExpression(ValueExpression)
insteadpublic ValueExpression getLabelExpression()
public void setLabelExpression(ValueExpression b)
@Deprecated public ValueBinding getStyleBinding()
getStyleExpression()
instead@Deprecated public void setStyleBinding(ValueBinding b)
setStyleExpression(ValueExpression)
insteadpublic ValueExpression getStyleExpression()
public void setStyleExpression(ValueExpression b)
@Deprecated public ValueBinding getValueBinding()
getValueExpression()
instead@Deprecated public void setValueBinding(ValueBinding b)
setValueExpression(ValueExpression)
insteadpublic ValueExpression getValueExpression()
public void setValueExpression(ValueExpression b)
@Deprecated public ValueBinding getEscapeBinding()
getEscapeExpression()
instead@Deprecated public void setEscapeBinding(ValueBinding b)
setEscapeExpression(ValueExpression)
insteadpublic ValueExpression getEscapeExpression()
public void setEscapeExpression(ValueExpression b)