Class GenericFilterUrlQueryParametersBinder
java.lang.Object
io.jmix.flowui.facet.urlqueryparameters.AbstractUrlQueryParametersBinder
io.jmix.flowui.facet.urlqueryparameters.GenericFilterUrlQueryParametersBinder
- All Implemented Interfaces:
HasInitialState,UrlQueryParametersFacet.Binder
public class GenericFilterUrlQueryParametersBinder
extends AbstractUrlQueryParametersBinder
implements HasInitialState
A binder class for managing URL query parameters related to a
GenericFilter component.
This class facilitates the serialization and deserialization of query parameters,
manages component state, and ensures updates based on the URL query parameters or filter configuration changes.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final recordA POJO class for storing configuration of theGenericFilter's initial state. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AccessManagerprotected org.springframework.context.ApplicationContextprotected Stringprotected Stringstatic final Stringstatic final Stringprotected GenericFilterprotected com.vaadin.flow.shared.Registrationprotected FilterUrlQueryParametersSupportprotected MetadataToolsstatic final Stringstatic final Stringprotected SingleFilterSupportprotected UiComponentsprotected UrlParamSerializerFields inherited from class io.jmix.flowui.facet.urlqueryparameters.AbstractUrlQueryParametersBinder
id -
Constructor Summary
ConstructorsConstructorDescriptionGenericFilterUrlQueryParametersBinder(GenericFilter filter, UrlParamSerializer urlParamSerializer, org.springframework.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidRestores the component to its initial state.protected voidprotected voidbindDataLoaderListener(GenericFilter filter) protected voidprotected List<FilterComponent> deserializeConditions(List<String> conditionParams, DataLoader dataLoader) protected StringdeserializeConfigurationId(String configurationParam) protected com.vaadin.flow.component.HasValueAndElement<?, ?> generatePropertyFilterValueComponent(PropertyFilter<?> propertyFilter) @Nullable com.vaadin.flow.component.ComponentReturns the component associated with this binder.Returns the current condition parameter name for the URL.Returns the current configuration parameter name for the URL.protected MetadataToolsprotected SingleFilterSupportprotected voidinitComponent(GenericFilter filter) protected booleanisOperationMatched(PropertyFilter<?> propertyFilter, PropertyFilter<?> anotherPropertyFilter) protected booleanisPermitted(DataLoader dataLoader, FilterComponent filterComponent) protected booleanisPropertyMatched(PropertyFilter<?> propertyFilter, PropertyFilter<?> anotherPropertyFilter) protected voidprotected voidprotected voidonPostLoad(EventObject event) protected FilterComponentparseCondition(String conditionString, DataLoader dataLoader) protected PropertyFilter<?> parsePropertyCondition(String conditionString, DataLoader dataLoader) voidSaves component's initial state.protected StringserializeConfigurationId(Configuration configuration) protected StringserializePropertyCondition(PropertyCondition condition) Serializes query parameters into an immutable map.voidsetConditionParam(@Nullable String conditionParam) Sets the condition parameter name for the URL.voidsetConfigurationParam(@Nullable String conditionParam) Sets the condition parameter name for the URL.protected voidprotected voidupdateConfigurationConditions(Configuration currentConfiguration, List<String> conditionParams) protected @Nullable FilterComponentupdateFilterComponent(FilterComponent configurationComponent, FilterComponent filterComponent) protected @Nullable FilterComponentupdatePropertyCondition(PropertyFilter configurationComponent, PropertyFilter filterComponent) protected voidvoidupdateState(com.vaadin.flow.router.QueryParameters queryParameters) Informs query parameters binder that view query parameters has been changed.Methods inherited from class io.jmix.flowui.facet.urlqueryparameters.AbstractUrlQueryParametersBinder
addUrlQueryParametersChangeListener, fireQueryParametersChanged, getEventBus, getId, getOwnerId, setId
-
Field Details
-
NAME
- See Also:
-
PROPERTY_CONDITION_PREFIX
- See Also:
-
DEFAULT_CONFIGURATION_PARAM
- See Also:
-
DEFAULT_CONDITION_PARAM
- See Also:
-
filter
-
configurationParam
-
conditionParam
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
urlParamSerializer
-
uiComponents
-
singleFilterSupport
-
metadataTools
-
filterUrlQueryParametersSupport
-
accessManager
-
filterComponentsChangeRegistration
protected com.vaadin.flow.shared.Registration filterComponentsChangeRegistration -
initialState
-
-
Constructor Details
-
Method Details
-
autowireDependencies
protected void autowireDependencies() -
initComponent
-
saveInitialState
public void saveInitialState()Description copied from interface:HasInitialStateSaves component's initial state.- Specified by:
saveInitialStatein interfaceHasInitialState
-
bindDataLoaderListener
-
onPostLoad
-
onConfigurationChanged
-
onFilterComponentsChanged
protected void onFilterComponentsChanged(LogicalFilterComponent.FilterComponentsChangeEvent<?> event) -
updateQueryParameters
protected void updateQueryParameters() -
serializeQueryParameters
Serializes query parameters into an immutable map. The method processes the current configuration and its associated conditions to generate query parameters.- Returns:
- an immutable map containing serialized query parameters. The keys represent parameter types (e.g., configuration and condition parameters), while the values are lists of their respective serialized representations.
-
serializeConfigurationId
-
serializePropertyCondition
-
applyInitialState
public void applyInitialState()Description copied from interface:HasInitialStateRestores the component to its initial state.- Specified by:
applyInitialStatein interfaceHasInitialState
-
updateState
public void updateState(com.vaadin.flow.router.QueryParameters queryParameters) Description copied from interface:UrlQueryParametersFacet.BinderInforms query parameters binder that view query parameters has been changed.- Specified by:
updateStatein interfaceUrlQueryParametersFacet.Binder- Parameters:
queryParameters- a view query parameters
-
deserializeConfigurationId
-
deserializeConditions
protected List<FilterComponent> deserializeConditions(List<String> conditionParams, DataLoader dataLoader) -
isPermitted
-
updateConfigurationConditions
protected void updateConfigurationConditions(Configuration currentConfiguration, List<String> conditionParams) -
updateFilterComponent
protected @Nullable FilterComponent updateFilterComponent(FilterComponent configurationComponent, FilterComponent filterComponent) -
updatePropertyCondition
protected @Nullable FilterComponent updatePropertyCondition(PropertyFilter configurationComponent, PropertyFilter filterComponent) -
parseCondition
-
parsePropertyCondition
-
generatePropertyFilterValueComponent
protected com.vaadin.flow.component.HasValueAndElement<?,?> generatePropertyFilterValueComponent(PropertyFilter<?> propertyFilter) -
bindFilterComponentsChangeListener
-
unbindFilterComponentsChange
protected void unbindFilterComponentsChange() -
getConfigurationParam
Returns the current configuration parameter name for the URL. If the parameter is null or empty, a default name is returned.- Returns:
- the configuration parameter name if set, otherwise the default configuration parameter name
-
setConfigurationParam
Sets the condition parameter name for the URL.- Parameters:
conditionParam- the condition parameter name to set
-
getConditionParam
Returns the current condition parameter name for the URL. If the condition parameter is null or empty, a default name is returned.- Returns:
- the condition parameter name if set, otherwise the default condition parameter name
-
setConditionParam
Sets the condition parameter name for the URL.- Parameters:
conditionParam- the condition parameter name to set
-
isPropertyMatched
protected boolean isPropertyMatched(PropertyFilter<?> propertyFilter, PropertyFilter<?> anotherPropertyFilter) -
isOperationMatched
protected boolean isOperationMatched(PropertyFilter<?> propertyFilter, PropertyFilter<?> anotherPropertyFilter) -
getMetadataTools
-
getSingleFilterSupport
-
getComponent
public @Nullable com.vaadin.flow.component.Component getComponent()Description copied from class:AbstractUrlQueryParametersBinderReturns the component associated with this binder.- Specified by:
getComponentin classAbstractUrlQueryParametersBinder- Returns:
- the component instance if available, or
nullif no component is associated
-