public abstract class DateTimeFormatInputElement extends FormatInputElement
Modifier and Type | Field and Description |
---|---|
protected Locale |
_locale |
protected TimeZone |
_tzone |
_value
Constructor and Description |
---|
DateTimeFormatInputElement() |
Modifier and Type | Method and Description |
---|---|
Locale |
getLocale()
Returns the locale associated with this component,
or null if
Locales.getCurrent() is preferred. |
org.zkoss.zk.ui.sys.PropertyAccess |
getPropertyAccess(String prop) |
TimeZone |
getTimeZone()
Returns the time zone that this component belongs to, or null if the
default time zone is used.
|
Date |
getValue()
Returns the value (in Date), might be null unless a constraint stops it.
|
LocalDate |
getValueInLocalDate()
Returns the value (in LocalDate), might be null unless a constraint stops it.
|
LocalDateTime |
getValueInLocalDateTime()
Returns the value (in LocalDateTime), might be null unless a constraint stops it.
|
LocalTime |
getValueInLocalTime()
Returns the value (in LocalTime), might be null unless a constraint stops it.
|
ZonedDateTime |
getValueInZonedDateTime()
Returns the value (in ZonedDateTime), might be null unless a constraint stops it.
|
protected ZoneId |
getZoneId() |
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setConstraint(Constraint constr)
Sets the constraint.
|
void |
setLocale(Locale locale)
Sets the locale used to identify the format of this component.
|
void |
setLocale(String locale)
Sets the locale used to identify the format of this component.
|
void |
setTimeZone(String id)
Sets the time zone that this component belongs to, or null if
the default time zone is used.
|
void |
setTimeZone(TimeZone tzone)
Sets the time zone that this component belongs to, or null if
the default time zone is used.
|
void |
setValue(Date value)
Sets the value (in Date).
|
void |
setValueInLocalDate(LocalDate value)
Sets the value (in LocalDate).
|
void |
setValueInLocalDateTime(LocalDateTime value)
Sets the value (in LocalDateTime).
|
void |
setValueInLocalTime(LocalTime value)
Sets the value (in LocalTime).
|
void |
setValueInZonedDateTime(ZonedDateTime value)
Sets the value (in ZonedDateTime).
|
protected Date |
toDate(LocalDate value) |
protected Date |
toDate(LocalDateTime value) |
protected Date |
toDate(LocalTime value) |
protected ZonedDateTime |
toZonedDateTime(Date value) |
getFormat, getRealFormat, setFormat
checkUserError, clearErrorMessage, clearErrorMessage, clone, coerceFromString, coerceToString, getCols, getConstraint, getErrorboxIconSclass, getErrorboxSclass, getErrorMessage, getInputAttributes, getInstant, getMaxlength, getName, getPlaceholder, getRawText, getRawValue, getTargetValue, getText, getType, isChildable, isDisabled, isInplace, isInstant, isMultiline, isReadonly, isValid, marshall, onWrongValue, select, service, setCols, setConstraint, setDisabled, setErrorboxIconSclass, setErrorboxSclass, setErrorMessage, setInplace, setInputAttributes, setInputAttributes, setInsertedText, setInstant, setMaxlength, setName, setPlaceholder, setRawValue, setReadonly, setSelectedText, setSelectionRange, setText, setValueDirectly, showCustomError, unmarshall, validate
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
addSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
public Locale getLocale()
Locales.getCurrent()
is preferred.public void setLocale(Locale locale)
Default: null (i.e., Locales.getCurrent()
, the current locale
is assumed)
public void setLocale(String locale)
Default: null (i.e., Locales.getCurrent()
, the current locale
is assumed)
public TimeZone getTimeZone()
The default time zone is determined by TimeZones.getCurrent()
.
public void setTimeZone(TimeZone tzone)
The default time zone is determined by TimeZones.getCurrent()
.
public void setTimeZone(String id)
The default time zone is determined by TimeZones.getCurrent()
.
id
- the time zone's ID, such as "America/Los_Angeles".
The time zone will be retrieved by calling TimeZone.getTimeZone(id).protected ZoneId getZoneId()
public void setConstraint(Constraint constr)
Constrainted
Default: null (means no constraint all all).
setConstraint
in interface Constrainted
setConstraint
in class InputElement
public Date getValue() throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException
- if user entered a wrong valuepublic void setValue(Date value) throws org.zkoss.zk.ui.WrongValueException
value
- the date to be assigned to this component.TimeZones.getCurrent()
), so it is easier
to work with other libraries, such as SQL.
Dates
has a set of utilities to simplify the task.org.zkoss.zk.ui.WrongValueException
- if value is wrongpublic ZonedDateTime getValueInZonedDateTime() throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException
- if user entered a wrong valuepublic void setValueInZonedDateTime(ZonedDateTime value) throws org.zkoss.zk.ui.WrongValueException
value
- the date to be assigned to this component.TimeZones.getCurrent()
), so it is easier
to work with other libraries, such as SQL.
Dates
has a set of utilities to simplify the task.org.zkoss.zk.ui.WrongValueException
- if value is wrongpublic LocalDateTime getValueInLocalDateTime() throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException
- if user entered a wrong valuepublic void setValueInLocalDateTime(LocalDateTime value) throws org.zkoss.zk.ui.WrongValueException
value
- the date to be assigned to this component.TimeZones.getCurrent()
), so it is easier
to work with other libraries, such as SQL.
Dates
has a set of utilities to simplify the task.org.zkoss.zk.ui.WrongValueException
- if value is wrongpublic LocalDate getValueInLocalDate() throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException
- if user entered a wrong valuepublic void setValueInLocalDate(LocalDate value) throws org.zkoss.zk.ui.WrongValueException
value
- the date to be assigned to this component.TimeZones.getCurrent()
), so it is easier
to work with other libraries, such as SQL.
Dates
has a set of utilities to simplify the task.org.zkoss.zk.ui.WrongValueException
- if value is wrongpublic LocalTime getValueInLocalTime() throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueException
- if user entered a wrong valuepublic void setValueInLocalTime(LocalTime value) throws org.zkoss.zk.ui.WrongValueException
value
- the date to be assigned to this component.TimeZones.getCurrent()
), so it is easier
to work with other libraries, such as SQL.
Dates
has a set of utilities to simplify the task.org.zkoss.zk.ui.WrongValueException
- if value is wrongprotected ZonedDateTime toZonedDateTime(Date value)
protected Date toDate(LocalDateTime value)
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
renderProperties
in class FormatInputElement
IOException
public org.zkoss.zk.ui.sys.PropertyAccess getPropertyAccess(String prop)
getPropertyAccess
in interface org.zkoss.zk.ui.sys.ComponentCtrl
getPropertyAccess
in class FormatInputElement
Copyright © 2020. All rights reserved.