Package org.zkoss.zul.impl
Class DateTimeFormatInputElement
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.impl.InputElement
org.zkoss.zul.impl.FormatInputElement
org.zkoss.zul.impl.DateTimeFormatInputElement
- All Implemented Interfaces:
Serializable,Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Disable,org.zkoss.zk.ui.ext.Readonly,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl,Constrainted
A skeletal implementation for date/time type input box.
- Since:
- 9.0.0
- Author:
- rudyhuang
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo -
Field Summary
FieldsFields inherited from class org.zkoss.zul.impl.InputElement
_cols, _valueFields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the locale associated with this component, or null ifLocales.getCurrent()is preferred.org.zkoss.zk.ui.sys.PropertyAccessgetPropertyAccess(String prop) Returns the time zone that this component belongs to, or null if the default time zone is used.getValue()Returns the value (in Date), might be null unless a constraint stops it.Returns the value (in LocalDate), might be null unless a constraint stops it.Returns the value (in LocalDateTime), might be null unless a constraint stops it.Returns the value (in LocalTime), might be null unless a constraint stops it.Returns the value (in ZonedDateTime), might be null unless a constraint stops it.protected ZoneIdprotected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) voidsetConstraint(Constraint constr) Sets the constraint.voidSets the locale used to identify the format of this component.voidSets the locale used to identify the format of this component.voidsetTimeZone(String id) Sets the time zone that this component belongs to, or null if the default time zone is used.voidsetTimeZone(TimeZone tzone) Sets the time zone that this component belongs to, or null if the default time zone is used.voidSets the value (in Date).voidsetValueInLocalDate(LocalDate value) Sets the value (in LocalDate).voidSets the value (in LocalDateTime).voidsetValueInLocalTime(LocalTime value) Sets the value (in LocalTime).voidSets the value (in ZonedDateTime).protected Dateprotected DatetoDate(LocalDateTime value) protected Dateprotected ZonedDateTimetoZonedDateTime(Date value) Methods inherited from class org.zkoss.zul.impl.FormatInputElement
getFormat, getRealFormat, setFormatMethods inherited from class org.zkoss.zul.impl.InputElement
checkUserError, clearErrorMessage, clearErrorMessage, clone, coerceFromString, coerceToString, getCols, getConstraint, getConstraintString, 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, validateMethods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setSkeleton, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, 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, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, 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, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Field Details
-
_locale
-
_tzone
-
-
Constructor Details
-
DateTimeFormatInputElement
public DateTimeFormatInputElement()
-
-
Method Details
-
getLocale
Returns the locale associated with this component, or null ifLocales.getCurrent()is preferred.- Since:
- 5.0.7
-
setLocale
Sets the locale used to identify the format of this component.Default: null (i.e.,
Locales.getCurrent(), the current locale is assumed)- Since:
- 5.0.7
-
setLocale
Sets the locale used to identify the format of this component.Default: null (i.e.,
Locales.getCurrent(), the current locale is assumed)- Since:
- 5.0.7
-
getTimeZone
Returns the time zone that this component belongs to, or null if the default time zone is used.The default time zone is determined by
TimeZones.getCurrent(). -
setTimeZone
Sets the time zone that this component belongs to, or null if the default time zone is used.The default time zone is determined by
TimeZones.getCurrent(). -
setTimeZone
Sets the time zone that this component belongs to, or null if the default time zone is used.The default time zone is determined by
TimeZones.getCurrent().- Parameters:
id- the time zone's ID, such as "America/Los_Angeles". The time zone will be retrieved by calling TimeZone.getTimeZone(id).
-
getZoneId
-
setConstraint
Description copied from interface:ConstraintedSets the constraint.Default: null (means no constraint all all).
- Specified by:
setConstraintin interfaceConstrainted- Overrides:
setConstraintin classInputElement
-
getValue
Returns the value (in Date), might be null unless a constraint stops it.- Throws:
org.zkoss.zk.ui.WrongValueException- if user entered a wrong value
-
setValue
Sets the value (in Date).- Parameters:
value- the date to be assigned to this component.
Notice that, if this component does not allow users to select the time (i.e., the format limited to year, month and day), the date specified here is better to set hour, minutes, seconds and milliseconds to zero (for the current timezone,TimeZones.getCurrent()), so it is easier to work with other libraries, such as SQL.Dateshas a set of utilities to simplify the task.- Throws:
org.zkoss.zk.ui.WrongValueException- if value is wrong
-
getValueInZonedDateTime
Returns the value (in ZonedDateTime), might be null unless a constraint stops it.- Throws:
org.zkoss.zk.ui.WrongValueException- if user entered a wrong value- Since:
- 9.0.0
-
setValueInZonedDateTime
Sets the value (in ZonedDateTime).- Parameters:
value- the date to be assigned to this component.
Notice that, if this component does not allow users to select the time (i.e., the format limited to year, month and day), the date specified here is better to set hour, minutes, seconds and milliseconds to zero (for the current timezone,TimeZones.getCurrent()), so it is easier to work with other libraries, such as SQL.Dateshas a set of utilities to simplify the task.- Throws:
org.zkoss.zk.ui.WrongValueException- if value is wrong- Since:
- 9.0.0
-
getValueInLocalDateTime
Returns the value (in LocalDateTime), might be null unless a constraint stops it.- Throws:
org.zkoss.zk.ui.WrongValueException- if user entered a wrong value- Since:
- 9.0.0
-
setValueInLocalDateTime
Sets the value (in LocalDateTime).- Parameters:
value- the date to be assigned to this component.
Notice that, if this component does not allow users to select the time (i.e., the format limited to year, month and day), the date specified here is better to set hour, minutes, seconds and milliseconds to zero (for the current timezone,TimeZones.getCurrent()), so it is easier to work with other libraries, such as SQL.Dateshas a set of utilities to simplify the task.- Throws:
org.zkoss.zk.ui.WrongValueException- if value is wrong- Since:
- 9.0.0
-
getValueInLocalDate
Returns the value (in LocalDate), might be null unless a constraint stops it.- Throws:
org.zkoss.zk.ui.WrongValueException- if user entered a wrong value- Since:
- 9.0.0
-
setValueInLocalDate
Sets the value (in LocalDate).- Parameters:
value- the date to be assigned to this component.
Notice that, if this component does not allow users to select the time (i.e., the format limited to year, month and day), the date specified here is better to set hour, minutes, seconds and milliseconds to zero (for the current timezone,TimeZones.getCurrent()), so it is easier to work with other libraries, such as SQL.Dateshas a set of utilities to simplify the task.- Throws:
org.zkoss.zk.ui.WrongValueException- if value is wrong- Since:
- 9.0.0
-
getValueInLocalTime
Returns the value (in LocalTime), might be null unless a constraint stops it.- Throws:
org.zkoss.zk.ui.WrongValueException- if user entered a wrong value- Since:
- 9.0.0
-
setValueInLocalTime
Sets the value (in LocalTime).- Parameters:
value- the date to be assigned to this component.
Notice that, if this component does not allow users to select the time (i.e., the format limited to year, month and day), the date specified here is better to set hour, minutes, seconds and milliseconds to zero (for the current timezone,TimeZones.getCurrent()), so it is easier to work with other libraries, such as SQL.Dateshas a set of utilities to simplify the task.- Throws:
org.zkoss.zk.ui.WrongValueException- if value is wrong- Since:
- 9.0.0
-
toZonedDateTime
-
toDate
-
toDate
-
toDate
-
renderProperties
- Overrides:
renderPropertiesin classFormatInputElement- Throws:
IOException
-
getPropertyAccess
- Specified by:
getPropertyAccessin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
getPropertyAccessin classFormatInputElement
-