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
FieldsModifier and TypeFieldDescriptionprotected CurrentAuthenticationprotected DateTimeTransformationsprotected MessageToolsprotected MetadataToolsprotected TimeSource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckValueSourceDatatypeMismatch(Datatype datatype, ValueSource valueSource) Throws IllegalArgumentException if component'sValueSourceandDatatypehave different types.protected javax.persistence.TemporalTypegetTemporalType(MetaProperty metaProperty, Class javaType) voidsetupCaseConversion(TextInputField.CaseConversionSupported component, EntityValueSource valueSource) Sets case conversion usingCaseConversionannotation on entity property.voidsetupDateFormat(DateField component, MetaProperty metaProperty) voidsetupDateFormat(DateField component, EntityValueSource valueSource) voidsetupDateFormat(DateField component, Class valueType) voidsetupDateRange(HasRange component, EntityValueSource valueSource) voidsetupMaxLength(TextInputField.MaxLengthLimited component, EntityValueSource valueSource) Sets max length for textual UI component using Entity metadata.voidsetupOptions(OptionsField optionsField, EntityValueSource valueSource) protected voidsetupTemporalType(DateField component, javax.persistence.TemporalType temporalType) voidsetupZoneId(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 usingCaseConversionannotation 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'sValueSourceandDatatypehave different types.- Parameters:
datatype- datatypevalueSource- component's value source
-
setupOptions
-