org.pm4j.core.pm
Interface PmAttrList<T>

All Superinterfaces:
java.lang.Comparable<PmObject>, PmAttr<java.util.List<T>>, PmDataInput, PmObject
All Known Implementing Classes:
PmAttrListImpl, PmAttrListImpl.PmAttrListOfIntegers, PmAttrListImpl.PmAttrListOfLongs, PmAttrListImpl.PmAttrListOfStrings

public interface PmAttrList<T>
extends PmAttr<java.util.List<T>>


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.pm4j.core.pm.PmAttr
PmAttr.Converter<T>
 
Field Summary
 
Fields inherited from interface org.pm4j.core.pm.PmObject
STYLE_CLASS_DISABLED, STYLE_CLASS_ERROR, STYLE_CLASS_INFO, STYLE_CLASS_REQUIRED, STYLE_CLASS_WARN
 
Method Summary
 int getSize()
           
 java.util.List<T> getValueAsList()
          An explicte list value signature.
 java.util.List<java.lang.String> getValueAsStringList()
          A string list interface for UI controls that only support string lists.
Example: rich:pickList
 java.util.List<T> getValueSubset(int fromIdx, int numItems)
          Provides a subset of the whole item set.
 void setValueAsList(java.util.List<T> value)
           
 void setValueAsStringList(java.util.List<java.lang.String> value)
          A string list interface for UI controls that only support string lists.
Example: rich:pickList
 
Methods inherited from interface org.pm4j.core.pm.PmAttr
getFormatString, getMaxLen, getMinLen, getOptionSet, getValue, getValueAsString, getValueLocalized, isPmValueChanged, isRequired, resetPmValues, setPmValueChanged, setValue, setValueAsString
 
Methods inherited from interface org.pm4j.core.pm.PmDataInput
commitBufferedPmChanges, isBufferedPmValueMode, pmValidate, rollbackBufferedPmChanges
 
Methods inherited from interface org.pm4j.core.pm.PmObject
accept, canSetPmTitle, compareTo, getPmConversation, getPmIconPath, getPmName, getPmParent, getPmProperty, getPmRelativeName, getPmShortTitle, getPmStyleClasses, getPmTitle, getPmTooltip, isPmEnabled, isPmReadonly, isPmValid, isPmVisible, setPmEnabled, setPmParent, setPmProperty, setPmTitle, setPmVisible
 

Method Detail

getValueAsList

java.util.List<T> getValueAsList()
An explicte list value signature. This signature is required for reflection based frameworks that analyze the method signature for their data binding (e.g. JSF). Such analysis for PmAttr.getValue() will just find out that the method returns an object. The same analysis perfomed on this method will provide the result that the returned value is a list...

Returns:
The list value.

setValueAsList

void setValueAsList(java.util.List<T> value)
Parameters:
value - The new list value.
See Also:
getValueAsList()

getValueAsStringList

java.util.List<java.lang.String> getValueAsStringList()
A string list interface for UI controls that only support string lists.
Example: rich:pickList

Attention: Will only work if an PmAttrListCfg.itemConverter() is defined.

Returns:
The items as a list of strings.

setValueAsStringList

void setValueAsStringList(java.util.List<java.lang.String> value)
                          throws org.pm4j.core.exception.PmConverterException
A string list interface for UI controls that only support string lists.
Example: rich:pickList

Attention: Will only work if an PmAttrListCfg.itemConverter() is defined.

Parameters:
value - The items as a list of strings.
Throws:
org.pm4j.core.exception.PmConverterException

getValueSubset

java.util.List<T> getValueSubset(int fromIdx,
                                 int numItems)
Provides a subset of the whole item set.

Parameters:
fromIdx - Index of the first item to get.
numItems - The maximal number of items to get.
Returns:
The subset. May be empty but never null

getSize

int getSize()
Returns:
number of list items provided by #{link PmAttr.getValue().