Class PropertyFilter<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.filter.SingleFilterComponentBase<V>
io.jmix.flowui.component.propertyfilter.PropertyFilter<V>
- Type Parameters:
V
- value type
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<V>>
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<V>>
,com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<V>>
,com.vaadin.flow.component.HasAriaLabel
,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
,com.vaadin.flow.component.shared.HasValidationProperties
,FilterComponent
,SingleFilterComponent<V>
,HasRequired
,SupportsLabelPosition
,SupportsValidation<V>
,HasSubParts
,Serializable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
A UI component used for filtering entities returned by the
DataLoader
.
The component is related to entity property and can automatically render proper
layout for setting a condition value. In general case a component layout
contains a label with entity property name, operation label or selector
(=, contains, >, etc.) and a field for editing a property value.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Operation representing corresponding filtering condition.protected static class
static class
Event sent when theoperation
property is changed.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
Modifier and TypeFieldDescriptionprotected PropertyFilter.Operation
protected boolean
protected DropdownButton
protected boolean
protected static final String
protected PropertyFilterSupport
protected SingleFilterSupport
Fields inherited from class io.jmix.flowui.component.filter.SingleFilterComponentBase
applicationContext, autoApply, conditionModificationDelegated, dataLoader, FILTER_LABEL_CLASS_NAME, label, labelDelegate, labelPosition, labelText, labelVisible, labelWidth, queryCondition, root, uiComponents, valueComponent
Fields inherited from interface io.jmix.flowui.component.HasRequired
PROPERTY_REQUIRED
Fields inherited from interface io.jmix.flowui.component.SupportsValidation
PROPERTY_ERROR_MESSAGE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addOperationChangeListener
(com.vaadin.flow.component.ComponentEventListener<PropertyFilter.OperationChangeEvent<V>> listener) Adds a listener that is invoked when theoperation
property changes.protected void
protected DropdownButton
protected PropertyCondition
protected String
getOperationText
(PropertyFilter.Operation operation) protected void
initOperationSelectorActions
(DropdownButton operationSelector) protected void
initRootComponent
(com.vaadin.flow.component.orderedlayout.HorizontalLayout root) boolean
boolean
protected void
void
setDataLoader
(DataLoader dataLoader) Sets aDataLoader
related to the current filter component.protected void
setLabelInternal
(String label) void
setOperation
(PropertyFilter.Operation operation) Sets a filtering operation.void
setOperationEditable
(boolean operationEditable) Sets whether an operation selector is visible.protected void
setOperationInternal
(PropertyFilter.Operation operation, boolean fromClient) void
setOperationTextVisible
(boolean operationLabelVisible) Sets whether to show operation text.void
setParameterName
(String parameterName) Sets the name of the associated query parameter name.void
setProperty
(String property) Sets related entity property name.void
setReadOnly
(boolean readOnly) void
setTabIndex
(int tabIndex) protected void
updateQueryCondition
(V newValue) Methods inherited from class io.jmix.flowui.component.filter.SingleFilterComponentBase
addValidator, afterPropertiesSet, apply, blur, checkValueComponentState, createLabel, createRootComponent, executeValidators, focus, generateModelValue, getAriaLabel, getAriaLabelledBy, getDataLoader, getLabel, getLabelPosition, getLabelWidth, getRequiredMessage, getRoot, getValueComponent, initComponent, initValueComponent, isAutoApply, isConditionModificationDelegated, isInvalid, isLabelVisible, onFieldInvalidChanged, onFieldStatusChanged, onFieldValueChanged, onFilterValueChanged, setApplicationContext, setAriaLabel, setAriaLabelledBy, setAutoApply, setConditionModificationDelegated, setInvalid, setLabel, setLabelDelegate, setLabelPosition, setLabelVisible, setLabelWidth, setPresentationValue, setRequired, setRequiredMessage, setupLoaderFirstResult, setValueComponent, setWidth, updateChildAlignment, updateDataLoaderCondition, updateLabelLayout
Methods inherited from class com.vaadin.flow.component.customfield.CustomField
add, addThemeVariants, onAttach, remove, removeThemeVariants, updateValue
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, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, 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, getTabIndex
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.HasHelper
getHelperComponent, getHelperText, setHelperComponent, setHelperText
Methods inherited from interface io.jmix.flowui.component.HasRequired
isRequired
Methods 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, setWidthFull
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.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
Methods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipText
Methods inherited from interface com.vaadin.flow.component.HasValue
clear, getOptionalValue
Methods inherited from interface com.vaadin.flow.component.HasValueAndElement
isReadOnly, isRequiredIndicatorVisible, setRequiredIndicatorVisible
Methods inherited from interface io.jmix.flowui.component.filter.SingleFilterComponent
getSubPart
Methods inherited from interface io.jmix.flowui.component.SupportsValidation
getErrorMessage, setErrorMessage
-
Field Details
-
PROPERTY_FILTER_CLASS_NAME
- See Also:
-
singleFilterSupport
-
propertyFilterSupport
-
operationSelector
-
operation
-
operationEditable
protected boolean operationEditable -
operationTextVisible
protected boolean operationTextVisible
-
-
Constructor Details
-
PropertyFilter
public PropertyFilter()
-
-
Method Details
-
autowireDependencies
protected void autowireDependencies()- Overrides:
autowireDependencies
in classSingleFilterComponentBase<V>
-
initRootComponent
protected void initRootComponent(com.vaadin.flow.component.orderedlayout.HorizontalLayout root) - Overrides:
initRootComponent
in classSingleFilterComponentBase<V>
-
getInnerComponentPrefix
- Specified by:
getInnerComponentPrefix
in classSingleFilterComponentBase<V>
-
createOperationSelector
-
initOperationSelectorActions
-
getOperationText
-
setDataLoader
Description copied from interface:FilterComponent
Sets aDataLoader
related to the current filter component.- Specified by:
setDataLoader
in interfaceFilterComponent
- Overrides:
setDataLoader
in classSingleFilterComponentBase<V>
- Parameters:
dataLoader
- aDataLoader
to set
-
getProperty
- Returns:
- related entity property name
-
setProperty
Sets related entity property name.- Parameters:
property
- entity property name
-
getOperation
- Returns:
- a filtering operation
-
setOperation
Sets a filtering operation.- Parameters:
operation
- a filtering operation
-
setOperationInternal
-
getParameterName
- Returns:
- the name of the associated query parameter name
-
setParameterName
Description copied from interface:SingleFilterComponent
Sets the name of the associated query parameter name.- Parameters:
parameterName
- a name of the associated query parameter name
-
createQueryCondition
- Specified by:
createQueryCondition
in classSingleFilterComponentBase<V>
-
getQueryCondition
- Specified by:
getQueryCondition
in interfaceFilterComponent
- Overrides:
getQueryCondition
in classSingleFilterComponentBase<V>
- Returns:
- a
PropertyCondition
related to the current property filter
-
updateQueryCondition
- Specified by:
updateQueryCondition
in classSingleFilterComponentBase<V>
-
addOperationChangeListener
public com.vaadin.flow.shared.Registration addOperationChangeListener(com.vaadin.flow.component.ComponentEventListener<PropertyFilter.OperationChangeEvent<V>> listener) Adds a listener that is invoked when theoperation
property changes.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
isOperationEditable
public boolean isOperationEditable()- Returns:
- whether an operation selector is visible.
-
setOperationEditable
public void setOperationEditable(boolean operationEditable) Sets whether an operation selector is visible.- Parameters:
operationEditable
- whether an operation selector is visible
-
isOperationTextVisible
public boolean isOperationTextVisible()- Returns:
- whether to show operation text
-
setOperationTextVisible
public void setOperationTextVisible(boolean operationLabelVisible) Sets whether to show operation text.- Parameters:
operationLabelVisible
- whether to show operation text
-
removeOperationSelector
protected void removeOperationSelector() -
setLabelInternal
- Overrides:
setLabelInternal
in classSingleFilterComponentBase<V>
-
setReadOnly
public void setReadOnly(boolean readOnly) - Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,
V>, V> - Specified by:
setReadOnly
in interfacecom.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,
V>, V> - Overrides:
setReadOnly
in classSingleFilterComponentBase<V>
-
setTabIndex
public void setTabIndex(int tabIndex) - Specified by:
setTabIndex
in interfacecom.vaadin.flow.component.Focusable<V>
- Overrides:
setTabIndex
in classSingleFilterComponentBase<V>
-