|
||||||||||
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.Label
org.apache.wicket.datetime.markup.html.basic.DateLabel
public class DateLabel
A label that is mapped to a java.util.Date
object and that uses Joda time to
format values.
You can provide a date pattern in two of the constructors. When not provided,
DateTimeFormat.shortDate()
will be used.
A special option is applyTimeZoneDifference which is an option that says whether to correct for the difference between the client's time zone and server's time zone. This is true by default.
DateTime
,
DateTimeFormat
,
DateTimeZone
,
Serialized FormNested 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 | |
---|---|
DateLabel(String id,
DateConverter converter)
Construct with a converter. |
|
DateLabel(String id,
IModel<Date> model,
DateConverter converter)
Construct with a converter. |
Method Summary | |
---|---|
static DateLabel |
forDatePattern(String id,
IModel<Date> model,
String datePattern)
Creates a new DateLabel defaulting to using a short date pattern |
static DateLabel |
forDatePattern(String id,
String datePattern)
Creates a new DateLabel defaulting to using a short date pattern |
static DateLabel |
forDateStyle(String id,
IModel<Date> model,
String dateStyle)
Creates a new DateLabel defaulting to using a short date pattern |
static DateLabel |
forDateStyle(String id,
String dateStyle)
Creates a new DateLabel defaulting to using a short date pattern |
static DateLabel |
forShortStyle(String id)
Creates a new DateLabel defaulting to using a short date pattern |
static DateLabel |
forShortStyle(String id,
IModel<Date> model)
Creates a new DateLabel defaulting to using a short date pattern |
String |
getAfter()
|
String |
getBefore()
|
IConverter |
getConverter(Class clazz)
Returns the specialized converter. |
protected void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Processes the body. |
void |
setAfter(String after)
|
void |
setBefore(String before)
|
static DateLabel |
withConverter(String id,
DateConverter converter)
Creates a new DateLabel using the provided converter. |
static DateLabel |
withConverter(String id,
IModel<Date> model,
DateConverter converter)
Creates a new DateLabel using the provided converter. |
Methods inherited from class org.apache.wicket.markup.html.basic.Label |
---|
onComponentTag |
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 DateLabel(String id, DateConverter converter)
id
- The component idconverter
- The converter to usepublic DateLabel(String id, IModel<Date> model, DateConverter converter)
id
- The component idmodel
- The modelconverter
- The converter to useMethod Detail |
---|
public static DateLabel forDatePattern(String id, IModel<Date> model, String datePattern)
id
- The id of the text fieldmodel
- The modeldatePattern
- The pattern to use. Must be not null. See SimpleDateFormat
for available
patterns.TextField
public static DateLabel forDatePattern(String id, String datePattern)
id
- The id of the text fielddatePattern
- The pattern to use. Must be not null. See SimpleDateFormat
for available
patterns.TextField
public static DateLabel forDateStyle(String id, IModel<Date> model, String dateStyle)
id
- The id of the text fieldmodel
- The modeldateStyle
- style to use in case no pattern is provided. Must be two characters from the set
{"S", "M", "L", "F", "-"}. Must be not null. See
DateTimeFormat.forStyle(String)
for options.TextField
public static DateLabel forDateStyle(String id, String dateStyle)
id
- The id of the text fielddateStyle
- style to use in case no pattern is provided. Must be two characters from the set
{"S", "M", "L", "F", "-"}. Must be not null. See
DateTimeFormat.forStyle(String)
for options.TextField
public static DateLabel forShortStyle(String id)
id
- The id of the text fieldTextField
public static DateLabel forShortStyle(String id, IModel<Date> model)
id
- The id of the text fieldmodel
- The modelTextField
public static DateLabel withConverter(String id, DateConverter converter)
id
- The id of the text fieldconverter
- the date converterTextField
public static DateLabel withConverter(String id, IModel<Date> model, DateConverter converter)
id
- The id of the text fieldmodel
- The modelconverter
- the date converterTextField
public String getAfter()
public String getBefore()
public IConverter getConverter(Class clazz)
getConverter
in interface IConverterLocator
getConverter
in class Component
clazz
- The type to convert to
public void setAfter(String after)
after
- append to labelpublic void setBefore(String before)
before
- prepend to labelprotected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
Component
onComponentTagBody
in class Label
markupStream
- The markup streamopenTag
- The open tag for the bodyComponent.onComponentTagBody(org.apache.wicket.markup.MarkupStream,
org.apache.wicket.markup.ComponentTag)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |