|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry.form.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.
| Field Summary | |
|---|---|
protected String |
_labelField
|
protected List |
_list
|
| 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 | |
|---|---|
boolean |
equals(Object o)
|
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. |
int |
hashCode()
|
boolean |
isDisabled(int index)
Used to help rendering of options that should be marked with the html disabled
attribute. |
String |
toString()
|
Object |
translateValue(String value)
Translate value to object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected List _list
protected String _labelField
| Constructor Detail |
|---|
public BeanPropertySelectionModel()
public BeanPropertySelectionModel(List list,
String labelField)
list - The listlabelField - The label field
public BeanPropertySelectionModel(Collection c,
String labelField)
c - CollectionlabelField - The label field| Method Detail |
|---|
public int getOptionCount()
getOptionCount in interface IPropertySelectionModelpublic Object getOption(int index)
getOption in interface IPropertySelectionModelindex - Index
public String getLabel(int index)
getLabel in interface IPropertySelectionModelindex - Index
public String getValue(int index)
getValue in interface IPropertySelectionModelindex - Index
public boolean isDisabled(int index)
IPropertySelectionModeldisabled
attribute.
isDisabled in interface IPropertySelectionModelindex - The option to check.
public Object translateValue(String value)
translateValue in interface IPropertySelectionModelvalue - Value
public String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||