|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.Component
org.apache.wicket.markup.html.WebComponent
org.apache.wicket.markup.html.basic.EnumLabel<T>
T - enum typepublic class EnumLabel<T extends Enum<T>>
A Label component that is used to render an enum value. The value renderered will be the result
of a i18n resource lookup of the following form:
<value.getClass().getSimpleName()>.<value.name()>, this format can be changed by
overriding resourceKey(Enum)
| Field Summary |
|---|
| Fields inherited from class org.apache.wicket.Component |
|---|
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
EnumLabel(String id)
Constructor |
|
EnumLabel(String id,
IModel<T> model)
|
|
EnumLabel(String id,
T value)
Convenience constructor. |
|
| Method Summary | |
|---|---|
IModel<T> |
getModel()
Gets model |
T |
getModelObject()
Gets model object |
protected String |
nullValue()
|
protected void |
onComponentTag(ComponentTag tag)
Processes the component tag. |
void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Processes the body. |
protected String |
resourceKey(T value)
Converts enum value into a resource key that should be used to lookup the text the label will display |
void |
setModel(IModel<T> model)
Sets model |
void |
setModelObject(T object)
Sets model object |
| Methods inherited from class org.apache.wicket.markup.html.WebComponent |
|---|
onRender |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EnumLabel(String id)
id - See Component
public EnumLabel(String id,
T value)
id - See Componentvalue - Enum value to renderComponent.Component(String, IModel)
public EnumLabel(String id,
IModel<T> model)
id - model - Component.Component(String, IModel)| Method Detail |
|---|
public void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Component
onComponentTagBody in class ComponentmarkupStream - The markup streamopenTag - The open tag for the bodyprotected String resourceKey(T value)
value -
protected String nullValue()
nullprotected void onComponentTag(ComponentTag tag)
Component
onComponentTag in class Componenttag - Tag to modifypublic final IModel<T> getModel()
public final void setModel(IModel<T> model)
model - public final T getModelObject()
public final void setModelObject(T object)
object -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||