org.trails.component
Class EnumPropertySelectionModel
java.lang.Object
org.trails.component.AbstractPropertySelectionModel
org.trails.component.EnumPropertySelectionModel
- All Implemented Interfaces:
- org.apache.tapestry.form.IPropertySelectionModel
public class EnumPropertySelectionModel
- extends AbstractPropertySelectionModel
Implementation of a property model that works off of native
java enum types.
The main diference with Tapestry's EnumPropertySelectionModel is that "allowNone" and the property used to get the
label values (labelProperty) are both configurable.
The enum label/values are all translated by calling the method indicated by "labelProperty"
By default labelProperty = "toString()", so it may be a good idea to provide a toString() method in your Enums if the
types aren't what you would prefer to display.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnumPropertySelectionModel
public EnumPropertySelectionModel(java.lang.Class type)
EnumPropertySelectionModel
public EnumPropertySelectionModel(java.lang.Enum[] set)
EnumPropertySelectionModel
public EnumPropertySelectionModel(java.lang.Enum[] set,
boolean allowNone)
EnumPropertySelectionModel
public EnumPropertySelectionModel(java.util.List instances,
boolean allowNone)
EnumPropertySelectionModel
public EnumPropertySelectionModel(java.lang.Class type,
boolean allowNone)
EnumPropertySelectionModel
public EnumPropertySelectionModel(java.lang.Class type,
java.lang.String labelProperty,
boolean allowNone)
getValue
public java.lang.String getValue(int index)
translateValue
public java.lang.Object translateValue(java.lang.String value)
Copyright © 2004-2008. All Rights Reserved.