org.apache.tapestry.coerce
Class StringConvertedPropertySelectionModel

java.lang.Object
  extended by org.apache.tapestry.coerce.StringConvertedPropertySelectionModel
All Implemented Interfaces:
IPropertySelectionModel

public final class StringConvertedPropertySelectionModel
extends Object
implements IPropertySelectionModel

IPropertySelectionModel created from a comma-seperated string by StringToPropertySelectionModelConverter.

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
StringConvertedPropertySelectionModel(String[] terms)
           
 
Method Summary
 String getLabel(int index)
          Returns the label for an option.
 Object getOption(int index)
          Returns one possible option that will be assigned to the server-side property.
 int getOptionCount()
          Returns the number of possible options.
 String getValue(int index)
          Returns a String used to represent the option in the HTML (as the value of an <option> or <input type=radio>.
 boolean isDisabled(int index)
          Used to help rendering of options that should be marked with the html disabled attribute.
 Object translateValue(String value)
          Returns the option corresponding to a value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringConvertedPropertySelectionModel

public StringConvertedPropertySelectionModel(String[] terms)
Method Detail

getOptionCount

public int getOptionCount()
Description copied from interface: IPropertySelectionModel
Returns the number of possible options.

Specified by:
getOptionCount in interface IPropertySelectionModel

getOption

public Object getOption(int index)
Description copied from interface: IPropertySelectionModel
Returns one possible option that will be assigned to the server-side property.

Specified by:
getOption in interface IPropertySelectionModel

getLabel

public String getLabel(int index)
Description copied from interface: IPropertySelectionModel
Returns the label for an option. It is the responsibility of the adaptor to make this value localized.

Specified by:
getLabel in interface IPropertySelectionModel

getValue

public String getValue(int index)
Description copied from interface: IPropertySelectionModel
Returns a String used to represent the option in the HTML (as the value of an <option> or <input type=radio>. This value is not visible to the user, and is often an index into an array.

Specified by:
getValue in interface IPropertySelectionModel

isDisabled

public boolean isDisabled(int index)
Description copied from interface: IPropertySelectionModel
Used to help rendering of options that should be marked with the html disabled attribute.

Specified by:
isDisabled in interface IPropertySelectionModel
Parameters:
index - The option to check.
Returns:
True if the option shouldn't be selectable, false otherwise.

translateValue

public Object translateValue(String value)
Description copied from interface: IPropertySelectionModel
Returns the option corresponding to a value. This is used when interpreting submitted form parameters.

Specified by:
translateValue in interface IPropertySelectionModel


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.