Package io.jmix.ui.component.data
Class DataAwareComponentsTools
java.lang.Object
io.jmix.ui.component.data.DataAwareComponentsTools
Utillity bean that provides typical data aware operations with UI components.
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentAuthentication
protected DateTimeTransformations
protected MessageTools
protected MetadataTools
protected TimeSource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkValueSourceDatatypeMismatch
(Datatype datatype, ValueSource valueSource) Throws IllegalArgumentException if component'sValueSource
andDatatype
have different types.protected javax.persistence.TemporalType
getTemporalType
(MetaProperty metaProperty, Class javaType) void
setupCaseConversion
(TextInputField.CaseConversionSupported component, EntityValueSource valueSource) Sets case conversion usingCaseConversion
annotation on entity property.void
setupDateFormat
(DateField component, MetaProperty metaProperty) void
setupDateFormat
(DateField component, EntityValueSource valueSource) void
setupDateFormat
(DateField component, Class valueType) void
setupDateRange
(HasRange component, EntityValueSource valueSource) void
setupMaxLength
(TextInputField.MaxLengthLimited component, EntityValueSource valueSource) Sets max length for textual UI component using Entity metadata.void
setupOptions
(OptionsField optionsField, EntityValueSource valueSource) protected void
setupTemporalType
(DateField component, javax.persistence.TemporalType temporalType) void
setupZoneId
(DateField component, EntityValueSource valueSource)
-
Field Details
-
currentAuthentication
-
messageTools
-
timeSource
-
dateTimeTransformations
-
metadataTools
-
-
Constructor Details
-
DataAwareComponentsTools
public DataAwareComponentsTools()
-
-
Method Details
-
setupCaseConversion
public void setupCaseConversion(TextInputField.CaseConversionSupported component, EntityValueSource valueSource) Sets case conversion usingCaseConversion
annotation on entity property.- Parameters:
component
- UI componentvalueSource
- value source
-
setupMaxLength
public void setupMaxLength(TextInputField.MaxLengthLimited component, EntityValueSource valueSource) Sets max length for textual UI component using Entity metadata.- Parameters:
component
- UI componentvalueSource
- value source
-
setupDateRange
-
setupZoneId
-
setupDateFormat
-
setupDateFormat
-
setupDateFormat
-
getTemporalType
@Nullable protected javax.persistence.TemporalType getTemporalType(@Nullable MetaProperty metaProperty, Class javaType) -
setupTemporalType
protected void setupTemporalType(DateField component, @Nullable javax.persistence.TemporalType temporalType) -
checkValueSourceDatatypeMismatch
public void checkValueSourceDatatypeMismatch(@Nullable Datatype datatype, @Nullable ValueSource valueSource) Throws IllegalArgumentException if component'sValueSource
andDatatype
have different types.- Parameters:
datatype
- datatypevalueSource
- component's value source
-
setupOptions
-