Package io.jmix.flowui.data
Class DataAwareComponentsTools
java.lang.Object
io.jmix.flowui.data.DataAwareComponentsTools
Utility bean that provides typical data aware operations with UI components.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CurrentAuthenticationprotected final DateTimeTransformationsprotected final MessageToolsprotected final MetadataToolsprotected final TimeSource -
Constructor Summary
ConstructorsConstructorDescriptionDataAwareComponentsTools(CurrentAuthentication currentAuthentication, MessageTools messageTools, TimeSource timeSource, DateTimeTransformations dateTimeTransformations, MetadataTools metadataTools) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> Optional<T>getMaxRange(Object currentMaxValue, EntityValueSource<?, ?> valueSource, Class<T> datatype) protected <T> Optional<T>getMinRange(Object currentMinValue, EntityValueSource<?, ?> valueSource, Class<T> datatype) protected jakarta.persistence.TemporalTypegetTemporalType(MetaProperty metaProperty, Class<?> javaType) voidsetupLength(HasLengthLimited component, EntityValueSource<?, ?> valueSource) Sets length limits for textual UI component using Entity metadata.voidsetupRange(com.vaadin.flow.component.datepicker.DatePicker component, EntityValueSource<?, ?> valueSource) Sets the selectable date range inLocalDateformat forDatePickercomponent using Entity metadata.voidsetupRange(com.vaadin.flow.component.datetimepicker.DateTimePicker component, EntityValueSource<?, ?> valueSource) Sets the selectable date range inLocalDateTimeformat forDateTimePickercomponent using Entity metadata.voidsetupRange(com.vaadin.flow.component.timepicker.TimePicker component, EntityValueSource<?, ?> valueSource) Sets the selectable time range inLocalTimeformat forTimePickercomponent using Entity metadata.voidsetupZoneId(HasZoneId component, EntityValueSource<?, ?> valueSource)
-
Field Details
-
currentAuthentication
-
messageTools
-
timeSource
-
dateTimeTransformations
-
metadataTools
-
-
Constructor Details
-
DataAwareComponentsTools
public DataAwareComponentsTools(CurrentAuthentication currentAuthentication, MessageTools messageTools, TimeSource timeSource, DateTimeTransformations dateTimeTransformations, MetadataTools metadataTools)
-
-
Method Details
-
setupLength
Sets length limits for textual UI component using Entity metadata.- Parameters:
component- UI componentvalueSource- value source
-
setupZoneId
- Parameters:
component- UI componentvalueSource- value source
-
setupRange
public void setupRange(com.vaadin.flow.component.datetimepicker.DateTimePicker component, EntityValueSource<?, ?> valueSource) Sets the selectable date range inLocalDateTimeformat forDateTimePickercomponent using Entity metadata.- Parameters:
component-DateTimePickercomponentvalueSource- value source
-
setupRange
public void setupRange(com.vaadin.flow.component.datepicker.DatePicker component, EntityValueSource<?, ?> valueSource) Sets the selectable date range inLocalDateformat forDatePickercomponent using Entity metadata.- Parameters:
component-DatePickercomponentvalueSource- value source
-
setupRange
public void setupRange(com.vaadin.flow.component.timepicker.TimePicker component, EntityValueSource<?, ?> valueSource) Sets the selectable time range inLocalTimeformat forTimePickercomponent using Entity metadata.- Parameters:
component-TimePickercomponentvalueSource- value source
-
getMaxRange
protected <T> Optional<T> getMaxRange(@Nullable Object currentMaxValue, EntityValueSource<?, ?> valueSource, Class<T> datatype) -
getMinRange
protected <T> Optional<T> getMinRange(@Nullable Object currentMinValue, EntityValueSource<?, ?> valueSource, Class<T> datatype) -
getTemporalType
@Nullable protected jakarta.persistence.TemporalType getTemporalType(@Nullable MetaProperty metaProperty, Class<?> javaType)
-