Class GeneratedVaadinTimePicker<R extends GeneratedVaadinTimePicker<R,T>,T>
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.AbstractField<C,T>
-
- com.vaadin.flow.component.AbstractSinglePropertyField<R,T>
-
- com.vaadin.flow.component.timepicker.GeneratedVaadinTimePicker<R,T>
-
- All Implemented Interfaces:
AttachNotifier,BlurNotifier<R>,DetachNotifier,Focusable<R>,FocusNotifier<R>,HasElement,HasEnabled,HasStyle,HasValue<AbstractField.ComponentValueChangeEvent<R,T>,T>,HasValueAndElement<AbstractField.ComponentValueChangeEvent<R,T>,T>,Serializable
- Direct Known Subclasses:
TimePicker
@Tag("vaadin-time-picker") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="23.2.17") @NpmPackage(value="@vaadin/time-picker",version="23.2.17") @NpmPackage(value="@vaadin/vaadin-time-picker",version="23.2.17") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/time-picker/src/vaadin-time-picker.js") public abstract class GeneratedVaadinTimePicker<R extends GeneratedVaadinTimePicker<R,T>,T> extends AbstractSinglePropertyField<R,T> implements HasStyle, Focusable<R>
Description copied from corresponding location in WebComponent:
<vaadin-time-picker>is a Web Component providing a time-selection field.<vaadin-time-picker></vaadin-time-picker>
timePicker.value = '14:30';When the selected
valueis changed, avalue-changedevent is triggered.Styling
The following custom properties are available for styling:
Custom properties available for styling Part name Description toggle-buttonThe toggle button See ThemableMixin – how to apply styles for shadow parts
The following state attributes are available for styling:
State attributes available for styling Attribute Description Part name disabledSet to a disabled time picker :host readonlySet to a read only time picker :host invalidSet when the element is invalid :host focusedSet when the element is focused :host focus-ringSet when the element is keyboard focused :host In addition to
<vaadin-time-picker>itself, the following internal components are themable:<vaadin-time-picker-text-field>, see<vaadin-text-field>documentation for the text field parts.<vaadin-combo-box-light>, see<vaadin-combo-box>documentation for the combo box parts.
Note: the
themeattribute value set on<vaadin-time-picker>is propagated to the internal themable components listed above.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeneratedVaadinTimePicker.InvalidChangeEvent<R extends GeneratedVaadinTimePicker<R,?>>-
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
AbstractField.ComponentValueChangeEvent<C extends Component,V>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
BlurNotifier.BlurEvent<C extends Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
FocusNotifier.FocusEvent<C extends Component>
-
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
-
-
Constructor Summary
Constructors Constructor Description GeneratedVaadinTimePicker()Default constructor.GeneratedVaadinTimePicker(T initialValue, T defaultValue, boolean acceptNullValues)Constructs a new GeneratedVaadinTimePicker component with the given arguments.GeneratedVaadinTimePicker(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableBiFunction<R,P,T> presentationToModel, SerializableBiFunction<R,T,P> modelToPresentation)Constructs a new GeneratedVaadinTimePicker component with the given arguments.GeneratedVaadinTimePicker(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableFunction<P,T> presentationToModel, SerializableFunction<T,P> modelToPresentation)Constructs a new GeneratedVaadinTimePicker component with the given arguments.GeneratedVaadinTimePicker(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableFunction<P,T> presentationToModel, SerializableFunction<T,P> modelToPresentation, boolean isInitialValueOptional)Constructs a new GeneratedVaadinTimePicker component with the given arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RegistrationaddInvalidChangeListener(ComponentEventListener<GeneratedVaadinTimePicker.InvalidChangeEvent<R>> listener)Adds a listener forinvalid-changedevents fired by the webcomponent.protected voidcheckValidity()Description copied from corresponding location in WebComponent:protected StringgetErrorMessageString()Description copied from corresponding location in WebComponent:protected elemental.json.JsonObjectgetI18nJsonObject()Description copied from corresponding location in WebComponent:protected StringgetLabelString()Description copied from corresponding location in WebComponent:protected StringgetMaxString()Description copied from corresponding location in WebComponent:protected StringgetMinString()Description copied from corresponding location in WebComponent:protected StringgetNameString()Description copied from corresponding location in WebComponent:protected StringgetPatternString()Description copied from corresponding location in WebComponent:protected StringgetPlaceholderString()Description copied from corresponding location in WebComponent:protected doublegetStepDouble()Description copied from corresponding location in WebComponent:protected booleanisAutofocusBoolean()Description copied from corresponding location in WebComponent:protected booleanisDisabledBoolean()Description copied from corresponding location in WebComponent:protected booleanisInvalidBoolean()Description copied from corresponding location in WebComponent:protected booleanisPreventInvalidInputBoolean()Description copied from corresponding location in WebComponent:protected booleanisReadonlyBoolean()Description copied from corresponding location in WebComponent:protected booleanisRequiredBoolean()Description copied from corresponding location in WebComponent:protected voidsetAutofocus(boolean autofocus)Description copied from corresponding location in WebComponent:protected voidsetDisabled(boolean disabled)Description copied from corresponding location in WebComponent:protected voidsetErrorMessage(String errorMessage)Description copied from corresponding location in WebComponent:protected voidsetI18n(elemental.json.JsonObject i18n)Description copied from corresponding location in WebComponent:protected voidsetInvalid(boolean invalid)Description copied from corresponding location in WebComponent:protected voidsetLabel(String label)Description copied from corresponding location in WebComponent:protected voidsetMax(String max)Description copied from corresponding location in WebComponent:protected voidsetMin(String min)Description copied from corresponding location in WebComponent:protected voidsetName(String name)Description copied from corresponding location in WebComponent:protected voidsetPattern(String pattern)Description copied from corresponding location in WebComponent:protected voidsetPlaceholder(String placeholder)Description copied from corresponding location in WebComponent:protected voidsetPreventInvalidInput(boolean preventInvalidInput)Description copied from corresponding location in WebComponent:protected voidsetReadonly(boolean readonly)Description copied from corresponding location in WebComponent:protected voidsetRequired(boolean required)Description copied from corresponding location in WebComponent:protected voidsetStep(double step)Description copied from corresponding location in WebComponent:protected voidvalidate()Description copied from corresponding location in WebComponent:-
Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, hasValidValue, setPresentationValue, setSynchronizedEvent
-
Methods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEquals
-
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
-
Methods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListener
-
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
-
Methods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndex
-
Methods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListener
-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
-
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Methods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValue
-
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible
-
-
-
-
Constructor Detail
-
GeneratedVaadinTimePicker
public GeneratedVaadinTimePicker(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableFunction<P,T> presentationToModel, SerializableFunction<T,P> modelToPresentation, boolean isInitialValueOptional)
Constructs a new GeneratedVaadinTimePicker component with the given arguments.If
isInitialValueOptionalistruethen the initial value is used only if element has no"value"property value, otherwise element"value"property is ignored and the initial value is set.- Type Parameters:
P- the property type- Parameters:
initialValue- the initial value to set to the valuedefaultValue- the default value to use if the value isn't definedelementPropertyType- the type of the element propertypresentationToModel- a function that converts a string value to a model valuemodelToPresentation- a function that converts a model value to a string valueisInitialValueOptional- ifisInitialValueOptionalistruethen the initial value is used only if element has no"value"property value, otherwise element"value"property is ignored and the initial value is set
-
GeneratedVaadinTimePicker
public GeneratedVaadinTimePicker(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableFunction<P,T> presentationToModel, SerializableFunction<T,P> modelToPresentation)
Constructs a new GeneratedVaadinTimePicker component with the given arguments.- Type Parameters:
P- the property type- Parameters:
initialValue- the initial value to set to the valuedefaultValue- the default value to use if the value isn't definedelementPropertyType- the type of the element propertypresentationToModel- a function that converts a string value to a model valuemodelToPresentation- a function that converts a model value to a string value
-
GeneratedVaadinTimePicker
public GeneratedVaadinTimePicker(T initialValue, T defaultValue, boolean acceptNullValues)
Constructs a new GeneratedVaadinTimePicker component with the given arguments.- Parameters:
initialValue- the initial value to set to the valuedefaultValue- the default value to use if the value isn't definedacceptNullValues- whethernullis accepted as a model value
-
GeneratedVaadinTimePicker
public GeneratedVaadinTimePicker(T initialValue, T defaultValue, Class<P> elementPropertyType, SerializableBiFunction<R,P,T> presentationToModel, SerializableBiFunction<R,T,P> modelToPresentation)
Constructs a new GeneratedVaadinTimePicker component with the given arguments.- Type Parameters:
P- the property type- Parameters:
initialValue- the initial value to set to the valuedefaultValue- the default value to use if the value isn't definedelementPropertyType- the type of the element propertypresentationToModel- a function that accepts this component and a property value and returns a model valuemodelToPresentation- a function that accepts this component and a model value and returns a property value
-
GeneratedVaadinTimePicker
public GeneratedVaadinTimePicker()
Default constructor.
-
-
Method Detail
-
isAutofocusBoolean
protected boolean isAutofocusBoolean()
Description copied from corresponding location in WebComponent:
Specify that this control should have input focus when the page loads.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
autofocusproperty from the webcomponent
-
setAutofocus
protected void setAutofocus(boolean autofocus)
Description copied from corresponding location in WebComponent:
Specify that this control should have input focus when the page loads.
- Parameters:
autofocus- the boolean value to set
-
isDisabledBoolean
protected boolean isDisabledBoolean()
Description copied from corresponding location in WebComponent:
Set to true to disable this input.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
disabledproperty from the webcomponent
-
setDisabled
protected void setDisabled(boolean disabled)
Description copied from corresponding location in WebComponent:
Set to true to disable this input.
- Parameters:
disabled- the boolean value to set
-
getNameString
protected String getNameString()
Description copied from corresponding location in WebComponent:
The name of this element.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
nameproperty from the webcomponent
-
setName
protected void setName(String name)
Description copied from corresponding location in WebComponent:
The name of this element.
- Parameters:
name- the String value to set
-
getLabelString
protected String getLabelString()
Description copied from corresponding location in WebComponent:
The label for this element.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
labelproperty from the webcomponent
-
setLabel
protected void setLabel(String label)
Description copied from corresponding location in WebComponent:
The label for this element.
- Parameters:
label- the String value to set
-
isRequiredBoolean
protected boolean isRequiredBoolean()
Description copied from corresponding location in WebComponent:
Set to true to mark the input as required.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
requiredproperty from the webcomponent
-
setRequired
protected void setRequired(boolean required)
Description copied from corresponding location in WebComponent:
Set to true to mark the input as required.
- Parameters:
required- the boolean value to set
-
isPreventInvalidInputBoolean
protected boolean isPreventInvalidInputBoolean()
Description copied from corresponding location in WebComponent:
Set to true to prevent the user from entering invalid input.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
preventInvalidInputproperty from the webcomponent
-
setPreventInvalidInput
protected void setPreventInvalidInput(boolean preventInvalidInput)
Description copied from corresponding location in WebComponent:
Set to true to prevent the user from entering invalid input.
- Parameters:
preventInvalidInput- the boolean value to set
-
getPatternString
protected String getPatternString()
Description copied from corresponding location in WebComponent:
A pattern to validate the
inputwith.This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
patternproperty from the webcomponent
-
setPattern
protected void setPattern(String pattern)
Description copied from corresponding location in WebComponent:
A pattern to validate the
inputwith.- Parameters:
pattern- the String value to set
-
getErrorMessageString
protected String getErrorMessageString()
Description copied from corresponding location in WebComponent:
The error message to display when the input is invalid.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
errorMessageproperty from the webcomponent
-
setErrorMessage
protected void setErrorMessage(String errorMessage)
Description copied from corresponding location in WebComponent:
The error message to display when the input is invalid.
- Parameters:
errorMessage- the String value to set
-
getPlaceholderString
protected String getPlaceholderString()
Description copied from corresponding location in WebComponent:
A placeholder string in addition to the label.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
placeholderproperty from the webcomponent
-
setPlaceholder
protected void setPlaceholder(String placeholder)
Description copied from corresponding location in WebComponent:
A placeholder string in addition to the label.
- Parameters:
placeholder- the String value to set
-
isReadonlyBoolean
protected boolean isReadonlyBoolean()
Description copied from corresponding location in WebComponent:
Set to true to prevent user picking a date or typing in the input.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
readonlyproperty from the webcomponent
-
setReadonly
protected void setReadonly(boolean readonly)
Description copied from corresponding location in WebComponent:
Set to true to prevent user picking a date or typing in the input.
- Parameters:
readonly- the boolean value to set
-
isInvalidBoolean
protected boolean isInvalidBoolean()
Description copied from corresponding location in WebComponent:
Set to true if the value is invalid.
This property is synchronized automatically from client side when a 'invalid-changed' event happens.
- Returns:
- the
invalidproperty from the webcomponent
-
setInvalid
protected void setInvalid(boolean invalid)
Description copied from corresponding location in WebComponent:
Set to true if the value is invalid.
- Parameters:
invalid- the boolean value to set
-
getMinString
protected String getMinString()
Description copied from corresponding location in WebComponent:
Minimum time allowed.
Supported time formats are in ISO 8601:
hh:mmhh:mm:sshh:mm:ss.fffThis property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
minproperty from the webcomponent
-
setMin
protected void setMin(String min)
Description copied from corresponding location in WebComponent:
Minimum time allowed.
Supported time formats are in ISO 8601:
hh:mmhh:mm:sshh:mm:ss.fff
- Parameters:
min- the String value to set
-
getMaxString
protected String getMaxString()
Description copied from corresponding location in WebComponent:
Maximum time allowed.
Supported time formats are in ISO 8601:
hh:mmhh:mm:sshh:mm:ss.fffThis property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
maxproperty from the webcomponent
-
setMax
protected void setMax(String max)
Description copied from corresponding location in WebComponent:
Maximum time allowed.
Supported time formats are in ISO 8601:
hh:mmhh:mm:sshh:mm:ss.fff
- Parameters:
max- the String value to set
-
getStepDouble
protected double getStepDouble()
Description copied from corresponding location in WebComponent:
Specifies the number of valid intervals in a day used for configuring the items displayed in the selection box.
It also configures the precision of the value string. By default the component formats values as
hh:mmbut setting a step value lower than one minute or one second, format resolution changes tohh:mm:ssandhh:mm:ss.fffrespectively.Unit must be set in seconds, and for correctly configuring intervals in the dropdown, it need to evenly divide a day.
Note: it is possible to define step that is dividing an hour in inexact fragments (i.e. 5760 seconds which equals 1 hour 36 minutes), but it is not recommended to use it for better UX experience.
This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.
- Returns:
- the
stepproperty from the webcomponent
-
setStep
protected void setStep(double step)
Description copied from corresponding location in WebComponent:
Specifies the number of valid intervals in a day used for configuring the items displayed in the selection box.
It also configures the precision of the value string. By default the component formats values as
hh:mmbut setting a step value lower than one minute or one second, format resolution changes tohh:mm:ssandhh:mm:ss.fffrespectively.Unit must be set in seconds, and for correctly configuring intervals in the dropdown, it need to evenly divide a day.
Note: it is possible to define step that is dividing an hour in inexact fragments (i.e. 5760 seconds which equals 1 hour 36 minutes), but it is not recommended to use it for better UX experience.
- Parameters:
step- the double value to set
-
getI18nJsonObject
protected elemental.json.JsonObject getI18nJsonObject()
Description copied from corresponding location in WebComponent:
The object used to localize this component. To change the default localization, replace the entire i18n object or just the property you want to modify.
The object has the following JSON structure:
{ // A function to format given Object as // time string. Object is in the format { hours: ..., minutes: ..., seconds: ..., milliseconds: ... } formatTime: (time) => { // returns a string representation of the given // object in 'hh' / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats }, // A function to parse the given text to an Object in the format // { hours: ..., minutes: ..., seconds: ..., milliseconds: ... }. // Must properly parse (at least) text // formatted by formatTime. parseTime: text => { // Parses a string in object/string that can be formatted by formatTime. } // Translation of the time selector icon button title. selector: 'Time selector', // Translation of the time selector clear button title. clear: 'Clear' } <p>This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.- Returns:
- the
i18nproperty from the webcomponent
-
setI18n
protected void setI18n(elemental.json.JsonObject i18n)
Description copied from corresponding location in WebComponent:
The object used to localize this component. To change the default localization, replace the entire i18n object or just the property you want to modify.
The object has the following JSON structure:
{ // A function to format given Object as // time string. Object is in the format { hours: ..., minutes: ..., seconds: ..., milliseconds: ... } formatTime: (time) => { // returns a string representation of the given // object in 'hh' / 'hh:mm' / 'hh:mm:ss' / 'hh:mm:ss.fff' - formats }, // A function to parse the given text to an Object in the format // { hours: ..., minutes: ..., seconds: ..., milliseconds: ... }. // Must properly parse (at least) text // formatted by formatTime. parseTime: text => { // Parses a string in object/string that can be formatted by formatTime. } // Translation of the time selector icon button title. selector: 'Time selector', // Translation of the time selector clear button title. clear: 'Clear' }- Parameters:
i18n- the JsonObject value to set
-
validate
@NotSupported protected void validate()
Description copied from corresponding location in WebComponent:
Returns true if
valueis valid, and sets theinvalidflag appropriately.This function is not supported by Flow because it returns a
boolean. Functions with return types different than void are not supported at this moment.
-
checkValidity
protected void checkValidity()
Description copied from corresponding location in WebComponent:
Returns true if the current input value satisfies all constraints (if any)
You can override the
checkValiditymethod for custom validations.
-
addInvalidChangeListener
protected Registration addInvalidChangeListener(ComponentEventListener<GeneratedVaadinTimePicker.InvalidChangeEvent<R>> listener)
Adds a listener forinvalid-changedevents fired by the webcomponent.- Parameters:
listener- the listener- Returns:
- a
Registrationfor removing the event listener
-
-