public class DateLabel extends Label implements IGenericComponent<Date>
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 FormENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING| Constructor and Description |
|---|
DateLabel(String id,
DateConverter converter)
Construct with a converter.
|
DateLabel(String id,
IModel<Date> model,
DateConverter converter)
Construct with a converter.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
<C> org.apache.wicket.util.convert.IConverter<C> |
getConverter(Class<C> clazz)
Returns the specialized converter.
|
IModel<Date> |
getModel() |
Date |
getModelObject() |
void |
onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) |
void |
setAfter(String after) |
void |
setBefore(String before) |
void |
setModel(IModel<Date> model) |
void |
setModelObject(Date object) |
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.
|
onComponentTaggetWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession, onRenderadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, get, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalInitialize, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onAfterRenderChildren, onBeforeRender, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModel, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, toString, toString, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrappublic 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 usepublic 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.TextFieldpublic 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.TextFieldpublic 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.TextFieldpublic 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.TextFieldpublic static DateLabel forShortStyle(String id)
id - The id of the text fieldTextFieldpublic static DateLabel forShortStyle(String id, IModel<Date> model)
id - The id of the text fieldmodel - The modelTextFieldpublic static DateLabel withConverter(String id, DateConverter converter)
id - The id of the text fieldconverter - the date converterTextFieldpublic static DateLabel withConverter(String id, IModel<Date> model, DateConverter converter)
id - The id of the text fieldmodel - The modelconverter - the date converterTextFieldpublic String getAfter()
public String getBefore()
public <C> org.apache.wicket.util.convert.IConverter<C> getConverter(Class<C> clazz)
getConverter in interface IConverterLocatorgetConverter in class Componentpublic void setAfter(String after)
after - append to labelpublic void setBefore(String before)
before - prepend to labelpublic void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
onComponentTagBody in class Labelpublic IModel<Date> getModel()
getModel in interface IGenericComponent<Date>public void setModel(IModel<Date> model)
setModel in interface IGenericComponent<Date>public void setModelObject(Date object)
setModelObject in interface IGenericComponent<Date>public Date getModelObject()
getModelObject in interface IGenericComponent<Date>Copyright © 2006–2016 Apache Software Foundation. All rights reserved.