public class UIDateTime extends UIComp implements IUIDateTime, IUIHint, IUILabelForTarget, IUIFocusComp, IUIDateTimeComponent, IUINullableValueComponent
IMessageBox.Icon
IVSComponentState.State
EMPTY, REMOTE_FOCUS_EVENT, styles, vsField
EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
ERROR, INFORMATION, NONE, REMOTE_FOCUS_EVENT, WARNING
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNING
Constructor and Description |
---|
UIDateTime()
Creates the component without a name.
|
UIDateTime(Atom propertyAtom)
Creates the component with the specified name.
|
UIDateTime(Atom propertyAtom,
GProp<?>[] newValue)
Creates the component with the specified name, initialized to contain the
GProp items. |
Modifier and Type | Method and Description |
---|---|
Size |
getApproximateSize()
Returns the size of the component in pixels.
|
UIDateTimeDataType |
getDataType()
Returns the date-time datatype for this component.
|
GDateTime |
getDefaultValue()
Gets the default value of the component as a GDateTime.
|
int |
getDeviceType()
Support for both mobile and desktop.
|
int |
getFormat()
Gets the format used.
|
GDateTime.Type |
getGDateTimeType()
Returns the GDateTime datatype for this component.
|
LocalDate |
getLocalDate()
Gets the local date part of the value.
|
int |
getMaximumYear()
Gets the maximum year for the mobile spinner.
|
int |
getMinimumYear()
Gets the minimum year for the mobile spinner.
|
UIDateTimeType |
getUIDateTimeType()
Returns the date-time type for this component.
|
GDateTime |
getValue()
Gets the current date-time value.
|
int |
getVisualLength()
Returns the visual length of the entry field.
|
ZoneId |
getZoneId()
Gets the zone of the value.
|
boolean |
hasCalendarButton()
Returns whether a button to show calendar should be present for date input (mobile only).
|
boolean |
isCalendarUsed()
Returns whether a calendar should be used for date input (mobile only).
|
boolean |
isDataTypeEnforced()
Returns if the enforcement of the datatype is set.
|
boolean |
isDateValueRequired()
Returns if the implementation requires a date in the value component.
|
boolean |
isDateValueSupported()
Returns if the implementation supports date.
|
boolean |
isDayMonthCombined()
Returns whether to combine day and month in a single spinner (mobile).
|
boolean |
isMillisecondsUsed()
Returns whether the time value should use milliseconds in time formats using seconds.
|
boolean |
isNullAllowed()
Returns if a null value is allowed, i.e.
|
boolean |
isTimeValueRequired()
Returns if the implementation requires a time in the value component.
|
boolean |
isTimeValueSupported()
Returns if the implementation supports time.
|
boolean |
isZoneUsed()
Returns whether the zone should be used for a ZonedTimeDate type.
|
void |
onEventSelf(GEvent event)
Processes events.
|
void |
onValueChanged(VSField field,
Value value,
GProp<?> trigger,
IPostEventProcessing postProcessing)
Called when the field value is set.
|
boolean |
setCombineDayMonth(boolean on)
Sets whether to combine day and month in a single spinner (mobile).
|
int |
setComponentToVSField()
Sets the value from component to its VirtualSpace field, if any.
|
static int |
setComponentToVSField(UIComp dateTimeComp,
VSField field)
Sets the value from component to its VirtualSpace field, if any.
|
boolean |
setDate(LocalDate localDate)
Sets the value as a local date with the locale information of the current user session
(or system default) in case value conversion is required.
|
boolean |
setDate(LocalDate localDate,
LocaleInfo localeInfo)
Sets the value as a local date.
|
boolean |
setFormat(int format)
Sets the format.
|
boolean |
setNullAllowed(boolean isNullAllowed)
Sets the null value allowed flag, i.e.
|
boolean |
setType(UIDateTimeType type,
UIDateTimeDataType dataType,
boolean doEnforceDataType)
Sets the date-time type, its datatype and the enforcement flag of the datatype.
|
boolean |
setUseCalendar(boolean on)
Sets whether a calendar should be used for date input (mobile only).
|
boolean |
setUseCalendarButton(boolean on)
Sets whether a calendar button should be shown for date input (mobile only).
|
boolean |
setUseMilliseconds(boolean on)
Sets whether the time value should use milliseconds in time formats using seconds.
|
boolean |
setUseZone(boolean on)
Sets whether the zone should be used for a ZonedTimeDate type.
|
boolean |
setValue(GDateTime value)
Sets the date-time value with the locale information of the current user session (or system default)
in case value conversion is required.
|
boolean |
setValue(GDateTime value,
LocaleInfo localeInfo)
Sets the date-time value.
|
boolean |
setValueToNull()
Sets the value to null.
|
boolean |
setYearRange(int min,
int max)
Sets the minimum and maximum year for the mobile spinner.
|
boolean |
setZoneId(ZoneId zone)
Sets the zone value.
|
add, addMappings, assignFontInfoResolver, canAcceptUIContainerFocus, canAlignX, canAlignY, canFillX, canFillY, canRequestFocus, canRequestFocus, clearErrorMessage, clone, couldRequestFocusIfVirtualized, createStyles, createTitleProp, disconnectVSField, enterVSProcessing, exitVSProcessing, fireSelection, fireSelection, forbiddenGetCustomDataMap, getBadge, getBestVSFieldValueType, getComponentID, getComponentMappings, getErrorMessage, getErrorMessage, getErrorMessageEx, getErrorMessageString, getErrorMessageString, getErrorMessageStringEx, getFirstContainerVSStateFocus, getFixHeight, getFixWidth, getFontInfo, getForcedAlignX, getForcedAlignY, getKStringText, getLayout, getLayoutMgr, getLayoutMgr, getMappedVSComponent, getMessage, getMessageText, getPixelHeight, getPixelWidth, getPredefinedProps, getSize, getStyles, getStyles, getText, getTitle, getTitleKS, getTitlePKS, getTooltip, getTooltipText, getTrigger, getUIPanel, getUIParent, getValue, getValue, getVirtualSpace, getVSField, getVSStateFocus, hasExplicitHeight, hasExplicitWidth, hasFocus, hasImplicitAlignFillX, hasImplicitAlignFillY, hasImplicitHeight, hasImplicitWidth, hasSelectionChanged, isEnabled, isMobile, isReadOnly, isRTL, isVisible, isVSFieldDisconnected, mustHaveExplicitHeight, mustHaveExplicitWidth, mustHaveHeight, mustHaveWidth, onBroken, onComponentSelectedInParent, onFocusGained, onNotifySelectionChanged, onParentStateChanged, onPrepare, onPrepare, onPropDispose, onRemoteEvent, onResolved, onSelectionChanged, onStateChanged, onVirtualizationCompleted, processVSComponentSelection, reconnectVSField, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusEx, requestFocusEx, requestFocusEx, requestFocusEx, setBadge, setBadge, setEnabled, setEnabled, setErrorMessage, setErrorMessage, setErrorMessage, setErrorMessage, setHTMLText, setLayoutMgr, setMessage, setMessage, setReadOnly, setReadOnly, setText, setText, setTitle, setTitle, setTitle, setTooltip, setTooltip, setUIContainerFocus, setVisible, setVisible, setVSFieldMessageToComponent, setVSFieldToComponent, verify, verifyComponentScope
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, completeVirtualize, containsProp, containsProp, convertLoadedProp, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, doVirtualizePropCnr, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getReferences, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isSibling, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropRemoved, onPropTreeInitialized, onReferenceEvent, paramString, prepare, removeAllProps, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verifyInternalUseOnly, verifyTree, virtualize
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, extendsClone, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onVirtualized, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, verifyHasPropertyItem, warning, warning, warning
getClass, hashCode, notify, notifyAll, wait, wait, wait
getDefaultValue, getLocalTime, setTime, setTime
getHintKString, getHintString, setHint, setHint
getComponentID
onFocusGained, onFocusLost
requestFocus, requestFocus, requestFocusEx, requestFocusEx
createValueProp, getValueOrDefault
canAcceptUIContainerFocus, disconnectVSField, getComponentID, getComponentMappings, getErrorMessage, getErrorMessage, getFirstUIComponent, getFirstUIComponentNull, getFixHeight, getFixWidth, getLayout, getLayoutMgr, getPanelUIComponent, getPanelUIComponentNull, getUIRef, getValue, getValue, getVirtualSpace, getVSField, isMobile, isRTL, isVSFieldDisconnected, reconnectVSField, setErrorMessage, setErrorMessage, setUIContainerFocus, setVSFieldMessageToComponent, setVSFieldToComponent
clearErrorMessage, getBadge, getKStringText, getLayoutMgr, getMessage, getMessageText, getStyles, getText, getTooltip, getTooltipText, getUIPanel, getUIParent, isEnabled, isReadOnly, isVisible, messageBox, requestFocus, requestFocus, requestFocusEx, requestFocusEx, setBadge, setBadge, setEnabled, setErrorMessage, setErrorMessage, setHTMLText, setLayoutMgr, setMessage, setMessage, setReadOnly, setText, setText, setTooltip, setTooltip, setVisible
messageBox, messageBox
getBestVSFieldValueType, onBroken, onResolved, onStateChanged
onParentStateChanged
forbiddenGetCustomDataMap, getCustomData, putCustomData, putCustomDataIfAbsent
isNull
public UIDateTime()
setPropertyAtom
call.public UIDateTime(Atom propertyAtom)
propertyAtom
- the name of the component, unique within it's parent.public UIDateTime(Atom propertyAtom, GProp<?>[] newValue) throws PropException
GProp
items. All system-reserved names for components
begins with "$".propertyAtom
- The name of the component, unique within it's parent.newValue
- The array of all properties the component should have.PropException
- when at least one of the properties to initialize
the component with is invalid.public int getDeviceType()
getDeviceType
in interface IUIComp
public UIDateTimeType getUIDateTimeType()
getUIDateTimeType
in interface IUIDateTime
public UIDateTimeDataType getDataType()
getDataType
in interface IUIDateTime
public GDateTime.Type getGDateTimeType()
getGDateTimeType
in interface IUIDateTime
public boolean isDataTypeEnforced()
isDataTypeEnforced
in interface IUIDateTime
public boolean setType(UIDateTimeType type, UIDateTimeDataType dataType, boolean doEnforceDataType)
Note 1: This method DOES NOT change the value, so the value may end up in the wrong datatype, and you should ensure that this does not occur.
Note 2: The doEnforceDataType
is always true for ZoneId type.
setType
in interface IUIDateTime
type
- The type.dataType
- The datatype.doEnforceDataType
- The enforcement flag: when true the datatype must match precisely,
when false, data conversion is done internally to retrieve the datatype
based on the current user's (or system) locale information.IllegalArgumentException
- If the type does not support the dataType.public void onEventSelf(GEvent event)
onEventSelf
in interface IGProp<GProp<?>[]>
onEventSelf
in class UIComp
event
- The property event.public int setComponentToVSField()
setComponentToVSField
in interface IUIComp
setComponentToVSField
in class UIComp
public static int setComponentToVSField(UIComp dateTimeComp, VSField field)
dateTimeComp
- The date/time component.field
- The field.public void onValueChanged(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
Components must override to provide the implementation when they are not implementing IPlainTextComponent, in this case the default implementation transports the field string value to this text components plain text.
onValueChanged
in interface IVSFieldListener
onValueChanged
in class UIComp
field
- The VS field.value
- The value, never null, but value.isNull()
could be true.trigger
- The trigger property that may be null.postProcessing
- Post-processing instance.public boolean isNullAllowed()
isNullAllowed
in interface IUIDateTime
isNullAllowed
in interface IUINullableValueComponent
public boolean setNullAllowed(boolean isNullAllowed)
Setting this parameter isNullAllowed
to false when the value already is null
will not affect the value.
setNullAllowed
in interface IUIDateTime
setNullAllowed
in interface IUINullableValueComponent
isNullAllowed
- Flag for null allowed.public boolean setValueToNull()
setValueToNull
in interface IUIDateTime
setValueToNull
in interface IUINullableValueComponent
IllegalStateException
- If the flag isNullAllowed()
is false
.public boolean setValue(GDateTime value)
setValue
in interface IUIDateTime
setValue
in interface IUIDateTimeComponent
value
- The value to set, null may be allowed depending on the flag returned
by isNullAllowed()
.IllegalArgumentException
- If the date/time type is enforced and not matching.IllegalStateException
- If the date/time conversion cannot possibly take place due to type mismatch.NullPointerException
- If the value is null and allow null is not enabled.public boolean setValue(GDateTime value, LocaleInfo localeInfo)
setValue
in interface IUIDateTime
value
- The value to set, null may be allowed depending on the flag returned
by isNullAllowed()
.localeInfo
- The locale information to use, or null to use the current user's or system default.IllegalArgumentException
- If the date/time type is enforced and not matching.IllegalStateException
- If the date/time conversion cannot possibly take place due to type mismatch.NullPointerException
- If the value is null and allow null is not enabled.public GDateTime getValue()
getValue
in interface IUIDateTime
getValue
in interface IUIDateTimeComponent
null
if the value is null and the flag isNullAllowed()
is set. The value may still be null if the "null-allowed" flag has been toggled recently
programmatically to false
but the value has not been assigned yet.public GDateTime getDefaultValue()
getDefaultValue
in interface IUIDateTime
getDefaultValue
in interface IUIDateTimeComponent
Time
), the epoch date as a LocalDate (1st of January
1970 for type Date
), the combination of the two above for type
DateTime
, and the current Zone ID of the user's session (or system default)
for ZoneId
.public boolean isTimeValueSupported()
isTimeValueSupported
in interface IUIDateTime
isTimeValueSupported
in interface IUIDateTimeComponent
public boolean isTimeValueRequired()
isTimeValueRequired
in interface IUIDateTime
isTimeValueRequired
in interface IUIDateTimeComponent
public boolean isDateValueSupported()
isDateValueSupported
in interface IUIDateTime
isDateValueSupported
in interface IUIDateTimeComponent
public boolean isDateValueRequired()
isDateValueRequired
in interface IUIDateTime
isDateValueRequired
in interface IUIDateTimeComponent
public LocalDate getLocalDate()
getLocalDate
in interface IUIDateTime
IllegalStateException
- If the value doesn't contain a date part, i.e. it's the wrong datatype.public boolean setDate(LocalDate localDate)
If the component is configured for the UIDateTimeType.DateTime
, this will
change only the date part of the value and keep offset, zone and/or date parts.
To set the entire value, use
or
setValue(GDateTime)
.setValue(GDateTime, LocaleInfo)
setDate
in interface IUIDateTime
localDate
- The local date to set, null is not allowed.IllegalArgumentException
- If the date/time type is enforced and not matching, or
in case the datatype is UIDateTimeType.Time
.NullPointerException
- If localDate
is null or in case the CURRENT value
is null and the datatype is UIDateTimeType.DateTime
.public boolean setDate(LocalDate localDate, LocaleInfo localeInfo)
If the component is configured for the UIDateTimeType.DateTime
, this will
change only the date part of the value and keep offset, zone and/or date parts.
To set the entire value, use
or
setValue(GDateTime)
.setValue(GDateTime, LocaleInfo)
setDate
in interface IUIDateTime
localDate
- The local date to set, null is not allowed.localeInfo
- The locale information to use, or null to use the current user's or system default.IllegalArgumentException
- If the date/time type is enforced and not matching, or
in case the datatype is UIDateTimeType.Time
or
UIDateTimeType.ZoneId
.NullPointerException
- If localDate
is null or in case the CURRENT value
is null and the datatype is UIDateTimeType.DateTime
.public ZoneId getZoneId()
getZoneId
in interface IUIDateTime
public boolean setZoneId(ZoneId zone)
If the component is configured for the UIDateTimeType.DateTime
, this will
change only the zone part of the value.
setZoneId
in interface IUIDateTime
zone
- The local date to set, null is not allowed.IllegalArgumentException
- If the date/time type is enforced and not matching, or
in case the datatype is UIDateTimeType.ZoneId
.NullPointerException
- If zone
is null or in case the CURRENT value
is null and the datatype is UIDateTimeType.DateTime
.public int getFormat()
getFormat
in interface IUIDateTime
public boolean setFormat(int format)
setFormat
in interface IUIDateTime
format
- The format as 0=short, 1=normal, 2=long or 3=full (default).IllegalArgumentException
- If the format is not 0-3.public int getMinimumYear()
getMinimumYear
in interface IUIDateTime
public int getMaximumYear()
getMaximumYear
in interface IUIDateTime
public boolean setYearRange(int min, int max)
setYearRange
in interface IUIDateTime
min
- The minimum year, or -1 for no minimum, i.e. current year minus 20.max
- The maximum year, or -1 for no maximum, i.e. current year plus 20.IllegalArgumentException
- If the min is larger than max or if either min or max is not in the range of 0-10_000.public boolean isZoneUsed()
isZoneUsed
in interface IUIDateTime
public boolean setUseZone(boolean on)
setUseZone
in interface IUIDateTime
on
- The flag.public boolean isCalendarUsed()
isCalendarUsed
in interface IUIDateTime
public boolean setUseCalendar(boolean on)
setUseCalendar
in interface IUIDateTime
on
- The flag.public boolean hasCalendarButton()
hasCalendarButton
in interface IUIDateTime
public boolean setUseCalendarButton(boolean on)
setUseCalendarButton
in interface IUIDateTime
on
- The flag.public boolean isMillisecondsUsed()
isMillisecondsUsed
in interface IUIDateTime
public boolean setUseMilliseconds(boolean on)
setUseMilliseconds
in interface IUIDateTime
on
- The flag.public boolean isDayMonthCombined()
isDayMonthCombined
in interface IUIDateTime
public boolean setCombineDayMonth(boolean on)
setCombineDayMonth
in interface IUIDateTime
on
- The flag.public int getVisualLength()
public Size getApproximateSize()
getApproximateSize
in class UIComp
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.