|
||||||||||
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)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.wicket.Component |
---|
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor<T extends Component>, Component.VisibilityChange |
Field Summary |
---|
Fields inherited from class org.apache.wicket.Component |
---|
ENABLE, FLAG_CONFIGURED, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, 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. |
protected 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 Componentpublic 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 |
---|
protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
Component
onComponentTagBody
in class Component
markupStream
- The markup streamopenTag
- The open tag for the bodyComponent.onComponentTagBody(org.apache.wicket.markup.MarkupStream,
org.apache.wicket.markup.ComponentTag)
protected String resourceKey(T value)
value
-
protected String nullValue()
null
protected void onComponentTag(ComponentTag tag)
Component
onComponentTag
in class Component
tag
- Tag to modifyComponent.onComponentTag(org.apache.wicket.markup.ComponentTag)
public 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 |