org.wicketopia.renderer
Class EnumChoiceRenderer<T extends Enum>

java.lang.Object
  extended by org.wicketopia.renderer.EnumChoiceRenderer<T>
All Implemented Interfaces:
Serializable, org.apache.wicket.markup.html.form.IChoiceRenderer<T>, org.apache.wicket.util.io.IClusterable

public class EnumChoiceRenderer<T extends Enum>
extends Object
implements org.apache.wicket.markup.html.form.IChoiceRenderer<T>

A choice renderer for enum values which allows internationalization of the display values. For enum value Bar from enum class com.myco.Foo, it will look for message key com.myco.Foo.Bar.

Since:
1.0
See Also:
Serialized Form

Constructor Summary
EnumChoiceRenderer(org.apache.wicket.markup.html.form.DropDownChoice<T> dropDownChoice)
           
 
Method Summary
 Object getDisplayValue(T enumValue)
           
 String getIdValue(T enumValue, int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumChoiceRenderer

public EnumChoiceRenderer(org.apache.wicket.markup.html.form.DropDownChoice<T> dropDownChoice)
Method Detail

getDisplayValue

public Object getDisplayValue(T enumValue)
Specified by:
getDisplayValue in interface org.apache.wicket.markup.html.form.IChoiceRenderer<T extends Enum>

getIdValue

public String getIdValue(T enumValue,
                         int index)
Specified by:
getIdValue in interface org.apache.wicket.markup.html.form.IChoiceRenderer<T extends Enum>


Copyright © 2010-2013. All Rights Reserved.