|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.tacos.model.BeanPropertySelectionModel
public class BeanPropertySelectionModel
This class is a property selection model for an object list.
This is used in PropertySelection, MultiplePropertySelection or Palette tapestry components.
For example, to use for a Hospital class, and have the labels be the hospital names.
List<Hospital> list = ...;
return new BeanPropertySelectionModel(hospitals, "name");
This will use getName() on the Hospital object, as its display.
Constructor Summary | |
---|---|
BeanPropertySelectionModel()
Build an empty property selection model. |
|
BeanPropertySelectionModel(Collection c,
String labelField)
Build a bean property selection model. |
|
BeanPropertySelectionModel(List list,
String labelField)
Build a bean property selection model. |
Method Summary | |
---|---|
String |
getLabel(int index)
Get the label at index. |
Object |
getOption(int index)
Get the option at index. |
int |
getOptionCount()
Get the number of options. |
String |
getValue(int index)
Get the value at index. |
Object |
translateValue(String value)
Translate value to object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanPropertySelectionModel()
public BeanPropertySelectionModel(List list, String labelField)
list
- The listlabelField
- The label fieldpublic BeanPropertySelectionModel(Collection c, String labelField)
c
- CollectionlabelField
- The label fieldMethod Detail |
---|
public int getOptionCount()
getOptionCount
in interface org.apache.tapestry.form.IPropertySelectionModel
public Object getOption(int index)
getOption
in interface org.apache.tapestry.form.IPropertySelectionModel
index
- Index
public String getLabel(int index)
getLabel
in interface org.apache.tapestry.form.IPropertySelectionModel
index
- Index
public String getValue(int index)
getValue
in interface org.apache.tapestry.form.IPropertySelectionModel
index
- Index
public Object translateValue(String value)
translateValue
in interface org.apache.tapestry.form.IPropertySelectionModel
value
- Value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |