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.
  • Field Details

  • Constructor Details

    • GenericFilterUrlQueryParametersBinder

      public GenericFilterUrlQueryParametersBinder(GenericFilter filter, UrlParamSerializer urlParamSerializer, org.springframework.context.ApplicationContext applicationContext)
  • Method Details

    • autowireDependencies

      protected void autowireDependencies()
    • initComponent

      protected void initComponent(GenericFilter filter)
    • saveInitialState

      public void saveInitialState()
      Description copied from interface: HasInitialState
      Saves component's initial state.
      Specified by:
      saveInitialState in interface HasInitialState
    • bindDataLoaderListener

      protected void bindDataLoaderListener(GenericFilter filter)
    • onPostLoad

      protected void onPostLoad(EventObject event)
    • onConfigurationChanged

      protected void onConfigurationChanged(GenericFilter.ConfigurationChangeEvent event)
    • onFilterComponentsChanged

      protected void onFilterComponentsChanged(LogicalFilterComponent.FilterComponentsChangeEvent<?> event)
    • updateQueryParameters

      protected void updateQueryParameters()
    • serializeQueryParameters

      public com.google.common.collect.ImmutableMap<String,List<String>> 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

      protected String serializeConfigurationId(Configuration configuration)
    • serializePropertyCondition

      protected String serializePropertyCondition(PropertyCondition condition)
    • applyInitialState

      public void applyInitialState()
      Description copied from interface: HasInitialState
      Restores the component to its initial state.
      Specified by:
      applyInitialState in interface HasInitialState
    • updateState

      public void updateState(com.vaadin.flow.router.QueryParameters queryParameters)
      Description copied from interface: UrlQueryParametersFacet.Binder
      Informs query parameters binder that view query parameters has been changed.
      Specified by:
      updateState in interface UrlQueryParametersFacet.Binder
      Parameters:
      queryParameters - a view query parameters
    • deserializeConfigurationId

      protected String deserializeConfigurationId(String configurationParam)
    • deserializeConditions

      protected List<FilterComponent> deserializeConditions(List<String> conditionParams, DataLoader dataLoader)
    • isPermitted

      protected boolean isPermitted(DataLoader dataLoader, FilterComponent filterComponent)
    • updateConfigurationConditions

      protected void updateConfigurationConditions(Configuration currentConfiguration, List<String> conditionParams)
    • updateFilterComponent

      @Nullable protected FilterComponent updateFilterComponent(FilterComponent configurationComponent, FilterComponent filterComponent)
    • updatePropertyCondition

      @Nullable protected FilterComponent updatePropertyCondition(PropertyFilter configurationComponent, PropertyFilter filterComponent)
    • parseCondition

      protected FilterComponent parseCondition(String conditionString, DataLoader dataLoader)
    • parsePropertyCondition

      protected PropertyFilter<?> parsePropertyCondition(String conditionString, DataLoader dataLoader)
    • generatePropertyFilterValueComponent

      protected com.vaadin.flow.component.HasValueAndElement<?,?> generatePropertyFilterValueComponent(PropertyFilter<?> propertyFilter)
    • bindFilterComponentsChangeListener

      protected void bindFilterComponentsChangeListener(GenericFilter filter)
    • unbindFilterComponentsChange

      protected void unbindFilterComponentsChange()
    • getConfigurationParam

      public String 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

      public void setConfigurationParam(@Nullable String conditionParam)
      Sets the condition parameter name for the URL.
      Parameters:
      conditionParam - the condition parameter name to set
    • getConditionParam

      public String 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

      public void setConditionParam(@Nullable String conditionParam)
      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

      protected MetadataTools getMetadataTools()
    • getSingleFilterSupport

      protected SingleFilterSupport getSingleFilterSupport()
    • getComponent

      @Nullable public com.vaadin.flow.component.Component getComponent()
      Description copied from class: AbstractUrlQueryParametersBinder
      Returns the component associated with this binder.
      Specified by:
      getComponent in class AbstractUrlQueryParametersBinder
      Returns:
      the component instance if available, or null if no component is associated