|
||||||||||
| 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 Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.wicket.Component |
|---|
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange |
| Field Summary |
|---|
| Fields inherited from class org.apache.wicket.Component |
|---|
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
DateLabel(java.lang.String id,
DateConverter converter)
Construct with a converter. |
|
DateLabel(java.lang.String id,
IModel model,
DateConverter converter)
Construct with a converter. |
|
| Method Summary | |
|---|---|
static DateLabel |
forDatePattern(java.lang.String id,
IModel 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 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 model)
Creates a new DateLabel defaulting to using a short date pattern |
java.lang.String |
getAfter()
|
java.lang.String |
getBefore()
|
IConverter |
getConverter(java.lang.Class clazz)
Returns the specialized converter. |
protected void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
|
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 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)
The - component idconverter - The converter to use
public DateLabel(java.lang.String id,
IModel model,
DateConverter converter)
The - component idThe - modelconverter - The converter to use| Method Detail |
|---|
public static DateLabel forDatePattern(java.lang.String id,
IModel 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 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.TextFieldpublic static DateLabel forShortStyle(java.lang.String id)
id - The id of the text fieldTextField
public static DateLabel forShortStyle(java.lang.String id,
IModel model)
id - The id of the text fieldmodel - The modelTextField
public static DateLabel withConverter(java.lang.String id,
DateConverter converter)
id - The id of the text fieldconverter - the date converterTextField
public static DateLabel withConverter(java.lang.String id,
IModel model,
DateConverter converter)
id - The id of the text fieldmodel - The modelconverter - the date converterTextFieldpublic java.lang.String getAfter()
public java.lang.String getBefore()
public IConverter getConverter(java.lang.Class clazz)
getConverter in interface IConverterLocatorgetConverter in class Componentpublic void setAfter(java.lang.String after)
after - append to labelpublic void setBefore(java.lang.String before)
before - prepend to label
protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag)
onComponentTagBody in class Label
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||