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

    • FILTER_LABEL_CLASS_NAME

      protected static final String FILTER_LABEL_CLASS_NAME
      See Also:
    • applicationContext

      protected org.springframework.context.ApplicationContext applicationContext
    • uiComponents

      protected UiComponents uiComponents
    • valueComponent

      protected com.vaadin.flow.component.HasValueAndElement<?,V> valueComponent
    • dataLoader

      protected DataLoader dataLoader
    • autoApply

      protected boolean autoApply
    • queryCondition

      protected Condition queryCondition
    • conditionModificationDelegated

      protected boolean conditionModificationDelegated
    • root

      protected com.vaadin.flow.component.orderedlayout.HorizontalLayout root
    • label

      protected com.vaadin.flow.component.html.Label label
    • labelText

      protected String labelText
    • labelWidth

      protected String labelWidth
    • labelVisible

      protected boolean labelVisible
    • labelPosition

      protected SupportsLabelPosition.LabelPosition labelPosition
    • labelDelegate

      protected Consumer<String> labelDelegate
  • Constructor Details

    • SingleFilterComponentBase

      public SingleFilterComponentBase()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • autowireDependencies

      protected void autowireDependencies()
    • initComponent

      protected void initComponent()
    • onFilterValueChanged

      protected void onFilterValueChanged(com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<V>,V> event)
    • 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

      protected V generateModelValue()
      Specified by:
      generateModelValue in class com.vaadin.flow.component.customfield.CustomField<V>
    • setPresentationValue

      protected void setPresentationValue(V newPresentationValue)
      Specified by:
      setPresentationValue in class com.vaadin.flow.component.customfield.CustomField<V>
    • createQueryCondition

      protected abstract Condition createQueryCondition()
    • updateQueryCondition

      protected abstract void updateQueryCondition(@Nullable V newValue)
    • getDataLoader

      public DataLoader getDataLoader()
      Specified by:
      getDataLoader in interface FilterComponent
      Returns:
      a DataLoader related to the current filter component
    • 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
      Parameters:
      dataLoader - a DataLoader to set
    • updateDataLoaderCondition

      protected void updateDataLoaderCondition()
    • isAutoApply

      public boolean isAutoApply()
      Specified by:
      isAutoApply in interface FilterComponent
      Returns:
      true if the filter component should be automatically applied to the DataLoader when the value component value is changed
    • setAutoApply

      public void setAutoApply(boolean autoApply)
      Description copied from interface: FilterComponent
      Sets whether the filter component should be automatically applied to the DataLoader when the value component value is changed.
      Specified by:
      setAutoApply in interface FilterComponent
      Parameters:
      autoApply - true if the filter component should be automatically applied to the DataLoader when the value component value is changed
    • isConditionModificationDelegated

      public boolean isConditionModificationDelegated()
      Specified by:
      isConditionModificationDelegated in interface FilterComponent
      Returns:
      true if the filter component is located inside the GenericFilter and the modification of DataLoader condition is delegated to the owner FilterComponent or GenericFilter, false otherwise
    • setConditionModificationDelegated

      public void setConditionModificationDelegated(boolean conditionModificationDelegated)
      Description copied from interface: FilterComponent
      Sets whether the modification of DataLoader condition is delegated to the owner FilterComponent or GenericFilter.
      Specified by:
      setConditionModificationDelegated in interface FilterComponent
      Parameters:
      conditionModificationDelegated - true if the filter component is located inside the GenericFilter and the modification of DataLoader condition is delegated to the owner FilterComponent or GenericFilter, false otherwise
    • getQueryCondition

      public Condition getQueryCondition()
      Specified by:
      getQueryCondition in interface FilterComponent
      Returns:
      a Condition related to the current filter component
    • apply

      public void apply()
      Description copied from interface: FilterComponent
      Applies the current filter component condition.
      Specified by:
      apply in interface FilterComponent
    • setupLoaderFirstResult

      protected void setupLoaderFirstResult()
    • getLabel

      @Nullable public String getLabel()
      Specified by:
      getLabel in interface com.vaadin.flow.component.HasLabel
      Overrides:
      getLabel in class com.vaadin.flow.component.customfield.CustomField<V>
    • setLabel

      public void setLabel(@Nullable String label)
      Specified by:
      setLabel in interface com.vaadin.flow.component.HasLabel
      Overrides:
      setLabel in class com.vaadin.flow.component.customfield.CustomField<V>
    • setLabelInternal

      protected void setLabelInternal(@Nullable String labelText)
    • setLabelDelegate

      public void setLabelDelegate(Consumer<String> labelDelegate)
    • getLabelPosition

      public SupportsLabelPosition.LabelPosition getLabelPosition()
      Specified by:
      getLabelPosition in interface SupportsLabelPosition
    • setLabelPosition

      public void setLabelPosition(SupportsLabelPosition.LabelPosition labelPosition)
      Specified by:
      setLabelPosition in interface SupportsLabelPosition
    • updateChildAlignment

      protected void updateChildAlignment()
    • updateLabelLayout

      protected void updateLabelLayout()
    • createLabel

      protected com.vaadin.flow.component.html.Label createLabel()
    • getInnerComponentPrefix

      public abstract String getInnerComponentPrefix()
    • getLabelWidth

      @Nullable public String getLabelWidth()
      Specified by:
      getLabelWidth in interface SingleFilterComponent<V>
      Returns:
      the width which has been set for the label
    • setLabelWidth

      public void setLabelWidth(@Nullable String labelWidth)
      Description copied from interface: SingleFilterComponent
      Sets the label width.

      The width should be in a format understood by the browser, e.g. "100px" or "2.5em".

      If the provided width value is null then width is removed.

      Specified by:
      setLabelWidth in interface SingleFilterComponent<V>
      Parameters:
      labelWidth - the width to set, may be null
    • isLabelVisible

      public boolean isLabelVisible()
      Specified by:
      isLabelVisible in interface SingleFilterComponent<V>
      Returns:
      true if label is visible
    • setLabelVisible

      public void setLabelVisible(boolean labelVisible)
      Description copied from interface: SingleFilterComponent
      Sets label visibility. Default value is true.
      Specified by:
      setLabelVisible in interface SingleFilterComponent<V>
      Parameters:
      labelVisible - whether to show label or not
    • setWidth

      public void setWidth(String width)
      Specified by:
      setWidth in interface com.vaadin.flow.component.HasSize
    • getValueComponent

      public com.vaadin.flow.component.HasValueAndElement<?,V> getValueComponent()
      Specified by:
      getValueComponent in interface SingleFilterComponent<V>
      Returns:
      a field for editing a property value
    • setValueComponent

      public void setValueComponent(com.vaadin.flow.component.HasValueAndElement<?,V> valueComponent)
      Description copied from interface: SingleFilterComponent
      Sets the field for editing a property value.
      Specified by:
      setValueComponent in interface SingleFilterComponent<V>
      Parameters:
      valueComponent - a field for editing a property value
    • initValueComponent

      protected void initValueComponent(com.vaadin.flow.component.HasValueAndElement<?,V> valueComponent)
    • onFieldValueChanged

      protected void onFieldValueChanged(com.vaadin.flow.component.HasValue.ValueChangeEvent<V> valueChangeEvent)
    • onFieldStatusChanged

      protected void onFieldStatusChanged(SupportsStatusChangeHandler.StatusContext<?> statusContext)
    • 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>
    • isInvalid

      public boolean isInvalid()
      Specified by:
      isInvalid in interface com.vaadin.flow.component.HasValidation
      Overrides:
      isInvalid in class com.vaadin.flow.component.customfield.CustomField<V>
    • setInvalid

      public void setInvalid(boolean invalid)
      Description copied from interface: SupportsValidation
      Sets 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:
      setInvalid in interface com.vaadin.flow.component.HasValidation
      Specified by:
      setInvalid in interface SupportsValidation<V>
      Overrides:
      setInvalid in class com.vaadin.flow.component.customfield.CustomField<V>
      Parameters:
      invalid - whether field should be invalid
    • getRequiredMessage

      @Nullable public String getRequiredMessage()
      Specified by:
      getRequiredMessage in interface HasRequired
    • setRequiredMessage

      public void setRequiredMessage(@Nullable String requiredMessage)
      Specified by:
      setRequiredMessage in interface HasRequired
    • setRequired

      public void setRequired(boolean required)
      Specified by:
      setRequired in interface HasRequired
    • addValidator

      public com.vaadin.flow.shared.Registration addValidator(Validator<? super V> validator)
      Specified by:
      addValidator in interface SupportsValidation<V>
    • executeValidators

      public void executeValidators() throws ValidationException
      Specified by:
      executeValidators in interface SupportsValidation<V>
      Throws:
      ValidationException
    • setTabIndex

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

      public void focus()
      Specified by:
      focus in interface com.vaadin.flow.component.Focusable<V>
    • blur

      public void blur()
      Specified by:
      blur in interface com.vaadin.flow.component.Focusable<V>
    • checkValueComponentState

      protected void checkValueComponentState()