|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 FormField 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 | |
---|---|
DateLabel(java.lang.String id,
DateConverter converter)
Construct with a converter. |
|
DateLabel(java.lang.String id,
IModel<java.util.Date> model,
DateConverter converter)
Construct with a converter. |
Method Summary | ||
---|---|---|
static DateLabel |
forDatePattern(java.lang.String id,
IModel<java.util.Date> model,
java.lang.String datePattern)
Creates a new DateLabel defaulting to using a short date pattern |
|
static DateLabel |
forDatePattern(java.lang.String id,
java.lang.String datePattern)
Creates a new DateLabel defaulting to using a short date pattern |
|
static DateLabel |
forDateStyle(java.lang.String id,
IModel<java.util.Date> model,
java.lang.String dateStyle)
Creates a new DateLabel defaulting to using a short date pattern |
|
static DateLabel |
forDateStyle(java.lang.String id,
java.lang.String dateStyle)
Creates a new DateLabel defaulting to using a short date pattern |
|
static DateLabel |
forShortStyle(java.lang.String id)
Creates a new DateLabel defaulting to using a short date pattern |
|
static DateLabel |
forShortStyle(java.lang.String id,
IModel<java.util.Date> model)
Creates a new DateLabel defaulting to using a short date pattern |
|
java.lang.String |
getAfter()
|
|
java.lang.String |
getBefore()
|
|
|
getConverter(java.lang.Class<C> clazz)
Returns the specialized converter. |
|
void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
Processes the body. |
|
void |
setAfter(java.lang.String after)
|
|
void |
setBefore(java.lang.String before)
|
|
static DateLabel |
withConverter(java.lang.String id,
DateConverter converter)
Creates a new DateLabel using the provided converter. |
|
static DateLabel |
withConverter(java.lang.String id,
IModel<java.util.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(java.lang.String id, DateConverter converter)
id
- The component idconverter
- The converter to usepublic DateLabel(java.lang.String id, IModel<java.util.Date> model, DateConverter converter)
id
- The component idmodel
- The modelconverter
- The converter to useMethod Detail |
---|
public static DateLabel forDatePattern(java.lang.String id, IModel<java.util.Date> model, java.lang.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(java.lang.String id, java.lang.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(java.lang.String id, IModel<java.util.Date> model, java.lang.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(java.lang.String id, java.lang.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(java.lang.String id)
id
- The id of the text field
TextField
public static DateLabel forShortStyle(java.lang.String id, IModel<java.util.Date> model)
id
- The id of the text fieldmodel
- The model
TextField
public static DateLabel withConverter(java.lang.String id, DateConverter converter)
id
- The id of the text fieldconverter
- the date converter
TextField
public static DateLabel withConverter(java.lang.String id, IModel<java.util.Date> model, DateConverter converter)
id
- The id of the text fieldmodel
- The modelconverter
- the date converter
TextField
public java.lang.String getAfter()
public java.lang.String getBefore()
public <C> IConverter<C> getConverter(java.lang.Class<C> clazz)
getConverter
in interface IConverterLocator
getConverter
in class Component
C
- The object to convert from and to Stringclazz
- The type to convert to
public void setAfter(java.lang.String after)
after
- append to labelpublic void setBefore(java.lang.String before)
before
- prepend to labelpublic void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
onComponentTagBody
in class Label
markupStream
- The markup streamopenTag
- The open tag for the body
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |