Package io.jmix.flowui.component.filer
Class SingleFilterComponentBase<V>
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<T>,T>
com.vaadin.flow.component.customfield.CustomField<V>
io.jmix.flowui.component.filer.SingleFilterComponentBase<V>
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,,V>, V> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,,V>, V> com.vaadin.flow.component.shared.HasTooltip,FilterComponent,SingleFilterComponent<V>,HasRequired,SupportsLabelPosition,SupportsValidation<V>,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
JpqlFilter,PropertyFilter
public abstract class SingleFilterComponentBase<V>
extends com.vaadin.flow.component.customfield.CustomField<V>
implements SingleFilterComponent<V>, SupportsLabelPosition, SupportsValidation<V>, HasRequired, com.vaadin.flow.component.shared.HasTooltip, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>Nested classes/interfaces inherited from interface io.jmix.flowui.component.SupportsLabelPosition
SupportsLabelPosition.LabelPosition -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected booleanprotected booleanprotected DataLoaderprotected static final Stringprotected com.vaadin.flow.component.html.Labelprotected SupportsLabelPosition.LabelPositionprotected Stringprotected booleanprotected Stringprotected Conditionprotected com.vaadin.flow.component.orderedlayout.HorizontalLayoutprotected UiComponentsprotected com.vaadin.flow.component.HasValueAndElement<?,V> Fields inherited from interface io.jmix.flowui.component.HasRequired
PROPERTY_REQUIREDFields inherited from interface io.jmix.flowui.component.SupportsValidation
PROPERTY_ERROR_MESSAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddValidator(Validator<? super V> validator) voidvoidapply()Applies the current filter component condition.protected voidvoidblur()protected voidprotected com.vaadin.flow.component.html.Labelprotected abstract Conditionprotected com.vaadin.flow.component.orderedlayout.HorizontalLayoutvoidvoidfocus()protected Vabstract StringgetLabel()com.vaadin.flow.component.orderedlayout.HorizontalLayoutgetRoot()com.vaadin.flow.component.HasValueAndElement<?,V> protected voidprotected voidinitRootComponent(com.vaadin.flow.component.orderedlayout.HorizontalLayout root) protected voidinitValueComponent(com.vaadin.flow.component.HasValueAndElement<?, V> valueComponent) booleanbooleanbooleanbooleanprotected voidonFieldStatusChanged(SupportsStatusChangeHandler.StatusContext<?> statusContext) protected voidonFieldValueChanged(com.vaadin.flow.component.HasValue.ValueChangeEvent<V> valueChangeEvent) protected voidonFilterValueChanged(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>, V> event) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetAutoApply(boolean autoApply) Sets whether the filter component should be automatically applied to theDataLoaderwhen the value component value is changed.voidsetConditionModificationDelegated(boolean conditionModificationDelegated) Sets whether the modification ofDataLoadercondition is delegated to the ownerFilterComponentorGenericFilter.voidsetDataLoader(DataLoader dataLoader) Sets aDataLoaderrelated to the current filter component.voidsetInvalid(boolean invalid) Sets invalid state to the field considering result of field validation.voidvoidsetLabelDelegate(Consumer<String> labelDelegate) protected voidsetLabelInternal(String labelText) voidsetLabelPosition(SupportsLabelPosition.LabelPosition labelPosition) voidsetLabelVisible(boolean labelVisible) Sets label visibility.voidsetLabelWidth(String labelWidth) Sets the label width.protected voidsetPresentationValue(V newPresentationValue) voidsetReadOnly(boolean readOnly) voidsetRequired(boolean required) voidsetRequiredMessage(String requiredMessage) voidsetTabIndex(int tabIndex) protected voidvoidsetValueComponent(com.vaadin.flow.component.HasValueAndElement<?, V> valueComponent) Sets the field for editing a property value.voidprotected voidprotected voidprotected voidprotected abstract voidupdateQueryCondition(V newValue) Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, getErrorMessage, onAttach, remove, removeThemeVariants, setErrorMessage, updateValueMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, getEmptyValue, getValue, isEmpty, setModelValue, setValue, valueEqualsMethods 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, onDetach, onEnabledStateChanged, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, getTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface io.jmix.flowui.component.HasRequired
isRequiredMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisibleMethods inherited from interface io.jmix.flowui.component.filer.SingleFilterComponent
getParameterName, setParameterNameMethods inherited from interface io.jmix.flowui.component.SupportsValidation
getErrorMessage, setErrorMessage
-
Field Details
-
FILTER_LABEL_CLASS_NAME
- See Also:
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
uiComponents
-
valueComponent
-
dataLoader
-
autoApply
protected boolean autoApply -
queryCondition
-
conditionModificationDelegated
protected boolean conditionModificationDelegated -
root
protected com.vaadin.flow.component.orderedlayout.HorizontalLayout root -
label
protected com.vaadin.flow.component.html.Label label -
labelText
-
labelWidth
-
labelVisible
protected boolean labelVisible -
labelPosition
-
labelDelegate
-
-
Constructor Details
-
SingleFilterComponentBase
public SingleFilterComponentBase()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
autowireDependencies
protected void autowireDependencies() -
initComponent
protected void initComponent() -
onFilterValueChanged
-
createRootComponent
protected com.vaadin.flow.component.orderedlayout.HorizontalLayout createRootComponent() -
initRootComponent
protected void initRootComponent(com.vaadin.flow.component.orderedlayout.HorizontalLayout root) -
getRoot
public com.vaadin.flow.component.orderedlayout.HorizontalLayout getRoot() -
generateModelValue
- Specified by:
generateModelValuein classcom.vaadin.flow.component.customfield.CustomField<V>
-
setPresentationValue
- Specified by:
setPresentationValuein classcom.vaadin.flow.component.customfield.CustomField<V>
-
createQueryCondition
-
updateQueryCondition
-
getDataLoader
- Specified by:
getDataLoaderin interfaceFilterComponent- Returns:
- a
DataLoaderrelated to the current filter component
-
setDataLoader
Description copied from interface:FilterComponentSets aDataLoaderrelated to the current filter component.- Specified by:
setDataLoaderin interfaceFilterComponent- Parameters:
dataLoader- aDataLoaderto set
-
updateDataLoaderCondition
protected void updateDataLoaderCondition() -
isAutoApply
public boolean isAutoApply()- Specified by:
isAutoApplyin interfaceFilterComponent- Returns:
trueif the filter component should be automatically applied to theDataLoaderwhen the value component value is changed
-
setAutoApply
public void setAutoApply(boolean autoApply) Description copied from interface:FilterComponentSets whether the filter component should be automatically applied to theDataLoaderwhen the value component value is changed.- Specified by:
setAutoApplyin interfaceFilterComponent- Parameters:
autoApply-trueif the filter component should be automatically applied to theDataLoaderwhen the value component value is changed
-
isConditionModificationDelegated
public boolean isConditionModificationDelegated()- Specified by:
isConditionModificationDelegatedin interfaceFilterComponent- Returns:
trueif the filter component is located inside theGenericFilterand the modification ofDataLoadercondition is delegated to the ownerFilterComponentorGenericFilter,falseotherwise
-
setConditionModificationDelegated
public void setConditionModificationDelegated(boolean conditionModificationDelegated) Description copied from interface:FilterComponentSets whether the modification ofDataLoadercondition is delegated to the ownerFilterComponentorGenericFilter.- Specified by:
setConditionModificationDelegatedin interfaceFilterComponent- Parameters:
conditionModificationDelegated-trueif the filter component is located inside theGenericFilterand the modification ofDataLoadercondition is delegated to the ownerFilterComponentorGenericFilter,falseotherwise
-
getQueryCondition
- Specified by:
getQueryConditionin interfaceFilterComponent- Returns:
- a
Conditionrelated to the current filter component
-
apply
public void apply()Description copied from interface:FilterComponentApplies the current filter component condition.- Specified by:
applyin interfaceFilterComponent
-
setupLoaderFirstResult
protected void setupLoaderFirstResult() -
getLabel
- Specified by:
getLabelin interfacecom.vaadin.flow.component.HasLabel- Overrides:
getLabelin classcom.vaadin.flow.component.customfield.CustomField<V>
-
setLabel
- Specified by:
setLabelin interfacecom.vaadin.flow.component.HasLabel- Overrides:
setLabelin classcom.vaadin.flow.component.customfield.CustomField<V>
-
setLabelInternal
-
setLabelDelegate
-
getLabelPosition
- Specified by:
getLabelPositionin interfaceSupportsLabelPosition
-
setLabelPosition
- Specified by:
setLabelPositionin interfaceSupportsLabelPosition
-
updateChildAlignment
protected void updateChildAlignment() -
updateLabelLayout
protected void updateLabelLayout() -
createLabel
protected com.vaadin.flow.component.html.Label createLabel() -
getInnerComponentPrefix
-
getLabelWidth
- Specified by:
getLabelWidthin interfaceSingleFilterComponent<V>- Returns:
- the width which has been set for the label
-
setLabelWidth
Description copied from interface:SingleFilterComponentSets the label width.The width should be in a format understood by the browser, e.g. "100px" or "2.5em".
If the provided
widthvalue is null then width is removed.- Specified by:
setLabelWidthin interfaceSingleFilterComponent<V>- Parameters:
labelWidth- the width to set, may benull
-
isLabelVisible
public boolean isLabelVisible()- Specified by:
isLabelVisiblein interfaceSingleFilterComponent<V>- Returns:
trueif label is visible
-
setLabelVisible
public void setLabelVisible(boolean labelVisible) Description copied from interface:SingleFilterComponentSets label visibility. Default value istrue.- Specified by:
setLabelVisiblein interfaceSingleFilterComponent<V>- Parameters:
labelVisible- whether to show label or not
-
setWidth
- Specified by:
setWidthin interfacecom.vaadin.flow.component.HasSize
-
getValueComponent
- Specified by:
getValueComponentin interfaceSingleFilterComponent<V>- Returns:
- a field for editing a property value
-
setValueComponent
Description copied from interface:SingleFilterComponentSets the field for editing a property value.- Specified by:
setValueComponentin interfaceSingleFilterComponent<V>- Parameters:
valueComponent- a field for editing a property value
-
initValueComponent
-
onFieldValueChanged
protected void onFieldValueChanged(com.vaadin.flow.component.HasValue.ValueChangeEvent<V> valueChangeEvent) -
onFieldStatusChanged
-
setReadOnly
public void setReadOnly(boolean readOnly) - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,V>, V> - Specified by:
setReadOnlyin interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,V>, V>
-
isInvalid
public boolean isInvalid()- Specified by:
isInvalidin interfacecom.vaadin.flow.component.HasValidation- Overrides:
isInvalidin classcom.vaadin.flow.component.customfield.CustomField<V>
-
setInvalid
public void setInvalid(boolean invalid) Description copied from interface:SupportsValidationSets invalid state to the field considering result of field validation.- Invalid - false and validation passed - false = field is invalid
- Invalid - false and validation passed - true = field is valid
- Invalid - true and validation passed - false = field is invalid
- Invalid - true and validation passed - true = field is invalid
- Specified by:
setInvalidin interfacecom.vaadin.flow.component.HasValidation- Specified by:
setInvalidin interfaceSupportsValidation<V>- Overrides:
setInvalidin classcom.vaadin.flow.component.customfield.CustomField<V>- Parameters:
invalid- whether field should be invalid
-
getRequiredMessage
- Specified by:
getRequiredMessagein interfaceHasRequired
-
setRequiredMessage
- Specified by:
setRequiredMessagein interfaceHasRequired
-
setRequired
public void setRequired(boolean required) - Specified by:
setRequiredin interfaceHasRequired
-
addValidator
- Specified by:
addValidatorin interfaceSupportsValidation<V>
-
executeValidators
- Specified by:
executeValidatorsin interfaceSupportsValidation<V>- Throws:
ValidationException
-
setTabIndex
public void setTabIndex(int tabIndex) - Specified by:
setTabIndexin interfacecom.vaadin.flow.component.Focusable<V>
-
focus
public void focus()- Specified by:
focusin interfacecom.vaadin.flow.component.Focusable<V>
-
blur
public void blur()- Specified by:
blurin interfacecom.vaadin.flow.component.Focusable<V>
-
checkValueComponentState
protected void checkValueComponentState()
-