|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.wicket.component.tools.ChoiceRendererNullable<T>
T - public class ChoiceRendererNullable<T extends Enum<T>>
IChoiceRenderer implementation that makes it easy to work with java 5 enums. This
renderer will attempt to lookup strings used for the display value using a localizer of a given
component. If the component is not specified, the global instance of localizer will be used for
lookups.
display value resource key format: <enum.getSimpleClassName()>.<enum.name()>
id value format: <enum.name()>
| Field Summary | |
|---|---|
protected static String |
UNDEFINED_ITEM_KEY
Undefined item Key |
| Constructor Summary | |
|---|---|
ChoiceRendererNullable()
Constructor that creates the choice renderer that will use global instance of localizer to resolve resource keys. |
|
ChoiceRendererNullable(org.apache.wicket.Component resourceSource)
Constructor |
|
| Method Summary | |
|---|---|
Object |
getDisplayValue(T item)
|
String |
getIdValue(T item,
int index)
|
protected String |
getUndefinedKey()
Localization key for undefined value |
protected CharSequence |
postprocess(String value)
Postprocesses the value after it is retrieved from the localizer. |
protected String |
resourceKey(T item)
Translates the object into resource key that will be used to lookup the value shown
to the user |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String UNDEFINED_ITEM_KEY
| Constructor Detail |
|---|
public ChoiceRendererNullable()
public ChoiceRendererNullable(org.apache.wicket.Component resourceSource)
resourceSource - | Method Detail |
|---|
public Object getDisplayValue(T item)
throws NullPointerException
getDisplayValue in interface org.apache.wicket.markup.html.form.IChoiceRenderer<T extends Enum<T>>NullPointerExceptionprotected String resourceKey(T item)
object into resource key that will be used to lookup the value shown
to the user
item -
protected CharSequence postprocess(String value)
value after it is retrieved from the localizer. Default
implementation escapes any markup found in the value.
value -
public String getIdValue(T item,
int index)
getIdValue in interface org.apache.wicket.markup.html.form.IChoiceRenderer<T extends Enum<T>>protected String getUndefinedKey()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||