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.filer.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>, 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

public class PropertyFilter<V> extends SingleFilterComponentBase<V>
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:
  • Field Details

  • Constructor Details

    • PropertyFilter

      public PropertyFilter()
  • Method Details

    • autowireDependencies

      protected void autowireDependencies()
      Overrides:
      autowireDependencies in class SingleFilterComponentBase<V>
    • initRootComponent

      protected void initRootComponent(com.vaadin.flow.component.orderedlayout.HorizontalLayout root)
      Overrides:
      initRootComponent in class SingleFilterComponentBase<V>
    • getInnerComponentPrefix

      public String getInnerComponentPrefix()
      Specified by:
      getInnerComponentPrefix in class SingleFilterComponentBase<V>
    • createOperationSelector

      protected DropdownButton createOperationSelector()
    • initOperationSelectorActions

      protected void initOperationSelectorActions(@Nullable DropdownButton operationSelector)
    • getOperationText

      protected String getOperationText(PropertyFilter.Operation operation)
    • setDataLoader

      public void setDataLoader(DataLoader dataLoader)
      Description copied from interface: FilterComponent
      Sets a DataLoader related to the current filter component.
      Specified by:
      setDataLoader in interface FilterComponent
      Overrides:
      setDataLoader in class SingleFilterComponentBase<V>
      Parameters:
      dataLoader - a DataLoader to set
    • getProperty

      @Nullable public String getProperty()
      Returns:
      related entity property name
    • setProperty

      public void setProperty(String property)
      Sets related entity property name.
      Parameters:
      property - entity property name
    • getOperation

      public PropertyFilter.Operation getOperation()
      Returns:
      a filtering operation
    • setOperation

      public void setOperation(PropertyFilter.Operation operation)
      Sets a filtering operation.
      Parameters:
      operation - a filtering operation
    • setOperationInternal

      protected void setOperationInternal(PropertyFilter.Operation operation, boolean fromClient)
    • getParameterName

      public String getParameterName()
      Returns:
      the name of the associated query parameter name
    • setParameterName

      public void setParameterName(String parameterName)
      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

      protected PropertyCondition createQueryCondition()
      Specified by:
      createQueryCondition in class SingleFilterComponentBase<V>
    • getQueryCondition

      public PropertyCondition getQueryCondition()
      Specified by:
      getQueryCondition in interface FilterComponent
      Overrides:
      getQueryCondition in class SingleFilterComponentBase<V>
      Returns:
      a PropertyCondition related to the current property filter
    • updateQueryCondition

      protected void updateQueryCondition(@Nullable V newValue)
      Specified by:
      updateQueryCondition in class SingleFilterComponentBase<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 the operation 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

      protected void setLabelInternal(@Nullable String label)
      Overrides:
      setLabelInternal in class SingleFilterComponentBase<V>
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,V>,V>
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,V>,V>
      Overrides:
      setReadOnly in class SingleFilterComponentBase<V>
    • setTabIndex

      public void setTabIndex(int tabIndex)
      Specified by:
      setTabIndex in interface com.vaadin.flow.component.Focusable<V>
      Overrides:
      setTabIndex in class SingleFilterComponentBase<V>