net.sf.beanform.util
Class EnumPropertySelectionModel<T extends Enum<T>>

java.lang.Object
  extended by net.sf.beanform.util.EnumPropertySelectionModel<T>
All Implemented Interfaces:
org.apache.tapestry.form.IPropertySelectionModel

public class EnumPropertySelectionModel<T extends Enum<T>>
extends Object
implements org.apache.tapestry.form.IPropertySelectionModel

A generic IPropertySelectionModel implementation for enumerations.

Author:
Daniel Gredler

Constructor Summary
EnumPropertySelectionModel(Class<T> type, boolean includeEmptyOption, Messages messages)
           
 
Method Summary
 String getLabel(int index)
           
 Object getOption(int index)
           
 int getOptionCount()
           
 String getValue(int index)
           
 boolean isDisabled(int index)
           
 Object translateValue(String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumPropertySelectionModel

public EnumPropertySelectionModel(Class<T> type,
                                  boolean includeEmptyOption,
                                  Messages messages)
Method Detail

getOptionCount

public int getOptionCount()
Specified by:
getOptionCount in interface org.apache.tapestry.form.IPropertySelectionModel

getOption

public Object getOption(int index)
Specified by:
getOption in interface org.apache.tapestry.form.IPropertySelectionModel

getLabel

public String getLabel(int index)
Specified by:
getLabel in interface org.apache.tapestry.form.IPropertySelectionModel

getValue

public String getValue(int index)
Specified by:
getValue in interface org.apache.tapestry.form.IPropertySelectionModel

translateValue

public Object translateValue(String value)
Specified by:
translateValue in interface org.apache.tapestry.form.IPropertySelectionModel

isDisabled

public boolean isDisabled(int index)
Specified by:
isDisabled in interface org.apache.tapestry.form.IPropertySelectionModel


Copyright © 2005-2008 SourceForge.net. All Rights Reserved.