Class UIDateTime
- java.lang.Object
- com.iizix.prop.GProp<GProp<?>[]>
- com.iizix.prop.PropCnr
- com.iizix.prop.ui.UIComp
- com.iizix.prop.ui.datetime.UIDateTime
- All Implemented Interfaces:
EventListener,IFocusComp,IMessageBox,IComponent,IClientBaseRelativeTarget,ICustomDataProvider,IGProp<GProp<?>[]>,IPropCnr,IUIDateTime,IUIComp,IUIFocusComp,IUIHint,IUILabelForTarget,IUIDateTimeComponent,IUINullableValueComponent,IUIValueComponent,IVSComponentListener,IVSComponentState,IVSFieldListener,java.lang.Cloneable
- Direct Known Subclasses:
EUIDateTime
public class UIDateTime extends UIComp implements IUIDateTime, IUIHint, IUILabelForTarget, IUIFocusComp, IUIDateTimeComponent, IUINullableValueComponent
Date/Time UI Component.- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox
IMessageBox.Icon
Nested classes/interfaces inherited from interface com.iizix.prop.vs.IVSComponentState
IVSComponentState.State
Field Summary
Fields inherited from class com.iizix.prop.ui.UIComp
EMPTY, REMOTE_FOCUS_EVENT, styles, vsField
Fields inherited from class com.iizix.prop.PropCnr
EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID
Fields inherited from class com.iizix.prop.GProp
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
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Fields inherited from interface com.iizix.gyro.IMessageBox
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNING
Fields inherited from interface com.iizix.prop.ui.IUIComp
ERROR, INFORMATION, NONE, REMOTE_FOCUS_EVENT, WARNING
Constructor Summary
Constructors Constructor 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 theGPropitems.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SizegetApproximateSize()Returns the size of the component in pixels.UIDateTimeDataTypegetDataType()Returns the date-time datatype for this component.GDateTimegetDefaultValue()Gets the default value of the component as a GDateTime.intgetDeviceType()Support for both mobile and desktop.intgetFormat()Gets the format used.GDateTime.TypegetGDateTimeType()Returns the GDateTime datatype for this component.java.time.LocalDategetLocalDate()Gets the local date part of the value.intgetMaximumYear()Gets the maximum year for the mobile spinner.intgetMinimumYear()Gets the minimum year for the mobile spinner.UIDateTimeTypegetUIDateTimeType()Returns the date-time type for this component.GDateTimegetValue()Gets the current date-time value.intgetVisualLength()Returns the visual length of the entry field.java.time.ZoneIdgetZoneId()Gets the zone of the value.booleanhasCalendarButton()Returns whether a button to show calendar should be present for date input (mobile only).booleanisCalendarUsed()Returns whether a calendar should be used for date input (mobile only).booleanisDataTypeEnforced()Returns if the enforcement of the datatype is set.booleanisDateValueRequired()Returns if the implementation requires a date in the value component.booleanisDateValueSupported()Returns if the implementation supports date.booleanisDayMonthCombined()Returns whether to combine day and month in a single spinner (mobile).booleanisMillisecondsUsed()Returns whether the time value should use milliseconds in time formats using seconds.booleanisNullAllowed()Returns if a null value is allowed, i.e.booleanisTimeValueRequired()Returns if the implementation requires a time in the value component.booleanisTimeValueSupported()Returns if the implementation supports time.booleanisZoneUsed()Returns whether the zone should be used for a ZonedTimeDate type.voidonEventSelf(GEvent event)Processes events.voidonValueChanged(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)Called when the field value is set.booleansetCombineDayMonth(boolean on)Sets whether to combine day and month in a single spinner (mobile).intsetComponentToVSField()Sets the value from component to its VirtualSpace field, if any.static intsetComponentToVSField(UIComp dateTimeComp, VSField field)Sets the value from component to its VirtualSpace field, if any.booleansetDate(java.time.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.booleansetDate(java.time.LocalDate localDate, LocaleInfo localeInfo)Sets the value as a local date.booleansetFormat(int format)Sets the format.booleansetNullAllowed(boolean isNullAllowed)Sets the null value allowed flag, i.e.booleansetType(UIDateTimeType type, UIDateTimeDataType dataType, boolean doEnforceDataType)Sets the date-time type, its datatype and the enforcement flag of the datatype.booleansetUseCalendar(boolean on)Sets whether a calendar should be used for date input (mobile only).booleansetUseCalendarButton(boolean on)Sets whether a calendar button should be shown for date input (mobile only).booleansetUseMilliseconds(boolean on)Sets whether the time value should use milliseconds in time formats using seconds.booleansetUseZone(boolean on)Sets whether the zone should be used for a ZonedTimeDate type.booleansetValue(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.booleansetValue(GDateTime value, LocaleInfo localeInfo)Sets the date-time value.booleansetValueToNull()Sets the value to null.booleansetYearRange(int min, int max)Sets the minimum and maximum year for the mobile spinner.booleansetZoneId(java.time.ZoneId zone)Sets the zone value.Methods inherited from class com.iizix.prop.ui.UIComp
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, resetComponentID, 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
Methods inherited from class com.iizix.prop.PropCnr
__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, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, 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, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, 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, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verifyInternalUseOnly, verifyTree, virtualize
Methods inherited from class com.iizix.prop.GProp
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, getModuleFolder, getModuleFolder, 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
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IClientBaseRelativeTarget
getComponentID
Methods inherited from interface com.iizix.IComponent
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
Methods inherited from interface com.iizix.prop.ICustomDataProvider
forbiddenGetCustomDataMap, getCustomData, putCustomData, putCustomDataIfAbsent
Methods inherited from interface com.iizix.gyro.IFocusComp
requestFocus, requestFocus, requestFocusEx, requestFocusEx
Methods inherited from interface com.iizix.prop.IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getReferences, getRelativePropName, getRootParent, getTreeLock, getValueClasses, getVSReference, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, list, list, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onPropTreeInitialized, onRemoteEvent, removePropError, removePropListener, renameProp, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toElementString, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropType, validatePropValue, verify, verifyHasPropertyItem, warning, warning, warning
Methods inherited from interface com.iizix.gyro.IMessageBox
messageBox, messageBox
Methods inherited from interface com.iizix.prop.IPropCnr
addProp, addProp, addProp2, addProp2, canRequestFocus, canRequestFocus, canRequestFocus, containsProp, containsProp, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, enablePropCommunication, enablePropHashMap, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsError, getExtendsName, 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, getProp, getProp, getPropCnr, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getString, getString, getString, getString, hasFocus, initializeExtendsFramework, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsRoot, isPropAddRemoveAllowed, isPropExtended, isSibling, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, requestFocus, requestFocusEx, setBool, setBool, setBool, setBool, 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, usePropHashMap, usesPropIndex, validateClassInstances
Methods inherited from interface com.iizix.prop.ui.IUIComp
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
Methods inherited from interface com.iizix.prop.ui.datetime.IUIDateTime
getDefaultValue, getLocalTime, setTime, setTime
Methods inherited from interface com.iizix.prop.ui.value.IUIDateTimeComponent
createValueProp, getValueOrDefault
Methods inherited from interface com.iizix.prop.ui.IUIFocusComp
onFocusGained, onFocusLost
Methods inherited from interface com.iizix.prop.ui.IUIHint
getHintKString, getHintString, setHint, setHint
Methods inherited from interface com.iizix.prop.ui.value.IUINullableValueComponent
isNull
Methods inherited from interface com.iizix.prop.vs.IVSComponentListener
onParentStateChanged
Methods inherited from interface com.iizix.prop.vs.IVSFieldListener
getBestVSFieldValueType, onBroken, onResolved, onStateChanged
Constructor Detail
UIDateTime
public UIDateTime()
Creates the component without a name. The name must be set in all cases using thesetPropertyAtomcall.
UIDateTime
public UIDateTime(Atom propertyAtom)
Creates the component with the specified name. All system-reserved names for components begins with "$".- Parameters:
propertyAtom- the name of the component, unique within it's parent.
UIDateTime
public UIDateTime(Atom propertyAtom, GProp<?>[] newValue) throws PropException
Creates the component with the specified name, initialized to contain theGPropitems. All system-reserved names for components begins with "$".- Parameters:
propertyAtom- The name of the component, unique within it's parent.newValue- The array of all properties the component should have.- Throws:
PropException- when at least one of the properties to initialize the component with is invalid.
Method Detail
getDeviceType
public int getDeviceType()
Support for both mobile and desktop.- Specified by:
getDeviceTypein interfaceIUIComp- Returns:
- 0=both.
getUIDateTimeType
public UIDateTimeType getUIDateTimeType()
Returns the date-time type for this component.- Specified by:
getUIDateTimeTypein interfaceIUIDateTime- Returns:
- Enum value as Time, Date, DateTime or ZoneId.
getDataType
public UIDateTimeDataType getDataType()
Returns the date-time datatype for this component.- Specified by:
getDataTypein interfaceIUIDateTime- Returns:
- Enum value as Time, Date, DateTime or ZoneId.
getGDateTimeType
public GDateTime.Type getGDateTimeType()
Returns the GDateTime datatype for this component.- Specified by:
getGDateTimeTypein interfaceIUIDateTime- Returns:
- Enum value as LocalTime, OffsetTime, LocalDate, LocalDateTime, OffsetDateTime or ZonedDateTime.
isDataTypeEnforced
public boolean isDataTypeEnforced()
Returns if the enforcement of the datatype is set.- Specified by:
isDataTypeEnforcedin interfaceIUIDateTime- Returns:
- true if the datatype when setting the value MUST be exactly the same datatype, or false (default) to allow conversion to the internal configured datatype. In the Designer, this value is called "Allow data conversion", and is default true.
setType
public boolean setType(UIDateTimeType type, UIDateTimeDataType dataType, boolean doEnforceDataType)
Sets the date-time type, its datatype and the enforcement flag of the datatype.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
doEnforceDataTypeis always true for ZoneId type.- Specified by:
setTypein interfaceIUIDateTime- Parameters:
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.- Returns:
- true if a change of type, datatype or enforcement occurred, false for no change.
- Throws:
java.lang.IllegalArgumentException- If the type does not support the dataType.
onEventSelf
public void onEventSelf(GEvent event)
Processes events.- Specified by:
onEventSelfin interfaceIGProp<GProp<?>[]>- Overrides:
onEventSelfin classUIComp- Parameters:
event- The property event.
setComponentToVSField
public int setComponentToVSField()
Sets the value from component to its VirtualSpace field, if any.- Specified by:
setComponentToVSFieldin interfaceIUIComp- Overrides:
setComponentToVSFieldin classUIComp- Returns:
- 1 for update completed, 0 for nothing done and -1 for error occurred.
setComponentToVSField
public static int setComponentToVSField(UIComp dateTimeComp, VSField field)
Sets the value from component to its VirtualSpace field, if any.- Parameters:
dateTimeComp- The date/time component.field- The field.- Returns:
- 1 for update completed, 0 for nothing done and -1 for error occurred.
onValueChanged
public void onValueChanged(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
Called when the field value is set.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.
- Specified by:
onValueChangedin interfaceIVSFieldListener- Overrides:
onValueChangedin classUIComp- Parameters:
field- The VS field.value- The value, never null, butvalue.isNull()could be true.trigger- The trigger property that may be null.postProcessing- Post-processing instance.
isNullAllowed
public boolean isNullAllowed()
Returns if a null value is allowed, i.e. no date/time value is set and the UI component is blank.- Specified by:
isNullAllowedin interfaceIUIDateTime- Specified by:
isNullAllowedin interfaceIUINullableValueComponent- Returns:
- true if null is allowed, or false (default) if not allowed.
setNullAllowed
public boolean setNullAllowed(boolean isNullAllowed)
Sets the null value allowed flag, i.e. allows no date/time value to be set and the UI component is blank.Setting this parameter
isNullAllowedto false when the value already isnullwill not affect the value.- Specified by:
setNullAllowedin interfaceIUIDateTime- Specified by:
setNullAllowedin interfaceIUINullableValueComponent- Parameters:
isNullAllowed- Flag for null allowed.- Returns:
- true if the setting changed, false for no change.
setValueToNull
public boolean setValueToNull()
Sets the value to null.- Specified by:
setValueToNullin interfaceIUIDateTime- Specified by:
setValueToNullin interfaceIUINullableValueComponent- Returns:
- true for value changed, false for no change.
- Throws:
java.lang.IllegalStateException- If the flagisisNullAllowed()false.
setValue
public 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.- Specified by:
setValuein interfaceIUIDateTime- Specified by:
setValuein interfaceIUIDateTimeComponent- Parameters:
value- The value to set, null may be allowed depending on the flag returned by.isNullAllowed()- Returns:
- true for value changed, false for no change to the value.
- Throws:
java.lang.IllegalArgumentException- If the date/time type is enforced and not matching.java.lang.IllegalStateException- If the date/time conversion cannot possibly take place due to type mismatch.java.lang.NullPointerException- If the value is null and allow null is not enabled.
setValue
public boolean setValue(GDateTime value, LocaleInfo localeInfo)
Sets the date-time value.- Specified by:
setValuein interfaceIUIDateTime- Parameters:
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.- Returns:
- true for value changed, false for no change to the value.
- Throws:
java.lang.IllegalArgumentException- If the date/time type is enforced and not matching.java.lang.IllegalStateException- If the date/time conversion cannot possibly take place due to type mismatch.java.lang.NullPointerException- If the value is null and allow null is not enabled.
getValue
public GDateTime getValue()
Gets the current date-time value.- Specified by:
getValuein interfaceIUIDateTime- Specified by:
getValuein interfaceIUIDateTimeComponent- Returns:
- The current value as configured with its datatype's corresponding GDateTime value, or
nullif the value is null and the flagis set. The value may still be null if the "null-allowed" flag has been toggled recently programmatically toisNullAllowed()falsebut the value has not been assigned yet.
getDefaultValue
public GDateTime getDefaultValue()
Gets the default value of the component as a GDateTime.- Specified by:
getDefaultValuein interfaceIUIDateTime- Specified by:
getDefaultValuein interfaceIUIDateTimeComponent- Returns:
- The default value depends on the date/time type, i.e. the time as midnight as a LocalTime (00:00:00 for type
Time), the epoch date as a LocalDate (1st of January 1970 for typeDate), the combination of the two above for typeDateTime, and the current Zone ID of the user's session (or system default) forZoneId.
isTimeValueSupported
public boolean isTimeValueSupported()
Returns if the implementation supports time.- Specified by:
isTimeValueSupportedin interfaceIUIDateTime- Specified by:
isTimeValueSupportedin interfaceIUIDateTimeComponent- Returns:
- false when time is not supported, true when setting a value requires a time part.
isTimeValueRequired
public boolean isTimeValueRequired()
Returns if the implementation requires a time in the value component.- Specified by:
isTimeValueRequiredin interfaceIUIDateTime- Specified by:
isTimeValueRequiredin interfaceIUIDateTimeComponent- Returns:
- true when time is required in the component, and null is not allowed.
isDateValueSupported
public boolean isDateValueSupported()
Returns if the implementation supports date.- Specified by:
isDateValueSupportedin interfaceIUIDateTime- Specified by:
isDateValueSupportedin interfaceIUIDateTimeComponent- Returns:
- false when date is not supported, true when setting a value requires a date part.
isDateValueRequired
public boolean isDateValueRequired()
Returns if the implementation requires a date in the value component.- Specified by:
isDateValueRequiredin interfaceIUIDateTime- Specified by:
isDateValueRequiredin interfaceIUIDateTimeComponent- Returns:
- true when date is required in the component, and null is not allowed.
getLocalDate
public java.time.LocalDate getLocalDate()
Gets the local date part of the value.- Specified by:
getLocalDatein interfaceIUIDateTime- Returns:
- Only the date part of the value, or null if the value is null.
- Throws:
java.lang.IllegalStateException- If the value doesn't contain a date part, i.e. it's the wrong datatype.
setDate
public boolean setDate(java.time.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.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, useorsetValue(GDateTime).setValue(GDateTime, LocaleInfo)- Specified by:
setDatein interfaceIUIDateTime- Parameters:
localDate- The local date to set, null is not allowed.- Throws:
java.lang.IllegalArgumentException- If the date/time type is enforced and not matching, or in case the datatype isUIDateTimeType.Time.java.lang.NullPointerException- IflocalDateis null or in case the CURRENT value is null and the datatype isUIDateTimeType.DateTime.
setDate
public boolean setDate(java.time.LocalDate localDate, LocaleInfo localeInfo)Sets the value as a local date.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, useorsetValue(GDateTime).setValue(GDateTime, LocaleInfo)- Specified by:
setDatein interfaceIUIDateTime- Parameters:
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.- Throws:
java.lang.IllegalArgumentException- If the date/time type is enforced and not matching, or in case the datatype isUIDateTimeType.TimeorUIDateTimeType.ZoneId.java.lang.NullPointerException- IflocalDateis null or in case the CURRENT value is null and the datatype isUIDateTimeType.DateTime.
getZoneId
public java.time.ZoneId getZoneId()
Gets the zone of the value.- Specified by:
getZoneIdin interfaceIUIDateTime- Returns:
- Only the zone part of the value, or null if the value is null or doesn't have a zone. It is non-null only when the value is non-null and datatype is one of OffsetTime, OffsetDateTime, ZonedDateTime or ZoneId.
setZoneId
public boolean setZoneId(java.time.ZoneId zone)
Sets the zone value.If the component is configured for the
UIDateTimeType.DateTime, this will change only the zone part of the value.- Specified by:
setZoneIdin interfaceIUIDateTime- Parameters:
zone- The local date to set, null is not allowed.- Throws:
java.lang.IllegalArgumentException- If the date/time type is enforced and not matching, or in case the datatype isUIDateTimeType.ZoneId.java.lang.NullPointerException- Ifzoneis null or in case the CURRENT value is null and the datatype isUIDateTimeType.DateTime.
getFormat
public int getFormat()
Gets the format used.- Specified by:
getFormatin interfaceIUIDateTime- Returns:
- The format as 0=short, 1=normal, 2=long or 3=full (default).
setFormat
public boolean setFormat(int format)
Sets the format.- Specified by:
setFormatin interfaceIUIDateTime- Parameters:
format- The format as 0=short, 1=normal, 2=long or 3=full (default).- Returns:
- true for changes, false for no change.
- Throws:
java.lang.IllegalArgumentException- If the format is not 0-3.
getMinimumYear
public int getMinimumYear()
Gets the minimum year for the mobile spinner.- Specified by:
getMinimumYearin interfaceIUIDateTime- Returns:
- The minimum year, or -1 if undefined.
getMaximumYear
public int getMaximumYear()
Gets the maximum year for the mobile spinner.- Specified by:
getMaximumYearin interfaceIUIDateTime- Returns:
- The minimum year, or -1 if undefined.
setYearRange
public boolean setYearRange(int min, int max)Sets the minimum and maximum year for the mobile spinner.- Specified by:
setYearRangein interfaceIUIDateTime- Parameters:
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.- Returns:
- true for changed, false for no change.
- Throws:
java.lang.IllegalArgumentException- If the min is larger than max or if either min or max is not in the range of 0-10_000.
isZoneUsed
public boolean isZoneUsed()
Returns whether the zone should be used for a ZonedTimeDate type.- Specified by:
isZoneUsedin interfaceIUIDateTime- Returns:
- true to use the zone or false (default) not to use the zone.
setUseZone
public boolean setUseZone(boolean on)
Sets whether the zone should be used for a ZonedTimeDate type.- Specified by:
setUseZonein interfaceIUIDateTime- Parameters:
on- The flag.- Returns:
- true for changes, false for no change.
isCalendarUsed
public boolean isCalendarUsed()
Returns whether a calendar should be used for date input (mobile only).- Specified by:
isCalendarUsedin interfaceIUIDateTime- Returns:
- true to use the calendar or false (default) to use spinners.
setUseCalendar
public boolean setUseCalendar(boolean on)
Sets whether a calendar should be used for date input (mobile only).- Specified by:
setUseCalendarin interfaceIUIDateTime- Parameters:
on- The flag.- Returns:
- true for changes, false for no change.
hasCalendarButton
public boolean hasCalendarButton()
Returns whether a button to show calendar should be present for date input (mobile only).- Specified by:
hasCalendarButtonin interfaceIUIDateTime- Returns:
- true to use the calendar or false (default) to use spinners.
setUseCalendarButton
public boolean setUseCalendarButton(boolean on)
Sets whether a calendar button should be shown for date input (mobile only).- Specified by:
setUseCalendarButtonin interfaceIUIDateTime- Parameters:
on- The flag.- Returns:
- true for changes, false for no change.
isMillisecondsUsed
public boolean isMillisecondsUsed()
Returns whether the time value should use milliseconds in time formats using seconds.- Specified by:
isMillisecondsUsedin interfaceIUIDateTime- Returns:
- true to use the zone or false (default) not to use the zone.
setUseMilliseconds
public boolean setUseMilliseconds(boolean on)
Sets whether the time value should use milliseconds in time formats using seconds.- Specified by:
setUseMillisecondsin interfaceIUIDateTime- Parameters:
on- The flag.- Returns:
- true for changes, false for no change.
isDayMonthCombined
public boolean isDayMonthCombined()
Returns whether to combine day and month in a single spinner (mobile).- Specified by:
isDayMonthCombinedin interfaceIUIDateTime- Returns:
- The flag, default false.
setCombineDayMonth
public boolean setCombineDayMonth(boolean on)
Sets whether to combine day and month in a single spinner (mobile).- Specified by:
setCombineDayMonthin interfaceIUIDateTime- Parameters:
on- The flag.- Returns:
- true for changes, false for no change.
getVisualLength
public int getVisualLength()
Returns the visual length of the entry field.- Returns:
- The visual length or 15 by default.
getApproximateSize
public Size getApproximateSize()
Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).- Specified by:
getApproximateSizein classUIComp- Returns:
- The size of the component.