Class TextFilter

All Implemented Interfaces:
Animatable<TextFilter>, CanDrop<TextFilter>, Draggable<TextFilter>, HandleHotKey<TextFilter>

Text filter component

The text filter component displays a text input field and a search button on the interface. The user can enter the filter condition into the text field and by pressing ENTER or by clicking on the search button the search is started.

The search is performed on all fields of type TEXT in the given DataDescriptor, concatenating the given search condition LIKE to all text columns and joins the columns with an OR condition. This results in all such records displayed to the user that contain the given search text in any of the text fields.

Supported events:

AnimationStart AnimationEnd, Drop, DragStart, DragEnd HotKey

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • TextFilter

      public TextFilter()
      Creates a TextFilter component
    • TextFilter

      public TextFilter(String language)
      Creates a TextFilter component for the given filter component in the language provided
      Parameters:
      language - The language code according to which the filter component is created. If not provided or entered as null, the filter component is created according to the default language setting of the framework. The default language for the framework is specified by the JBStrap parameter DEFAULT_LANGUAGE.
    • TextFilter

      public TextFilter(String language, FilterBarFiltering<?> filtering)
      Creates a TextFilter component for the given filter component in the language provided
      Parameters:
      language - The language code according to which the filter component is created. If not provided or entered as null, the filter component is created according to the default language setting of the framework. The default language for the framework is specified by the JBStrap parameter DEFAULT_LANGUAGE.
      filtering - An instance of the component to be filtered. The component specified here must implement the interface FilterBarFiltering.
    • TextFilter

      public TextFilter(String id, String language, FilterBarFiltering<?> filtering)
      Creates a TextFilter component for the given filter component in the language provided
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
      language - The language code according to which the filter component is created. If not provided or entered as null, the filter component is created according to the default language setting of the framework. The default language for the framework is specified by the JBStrap parameter DEFAULT_LANGUAGE.
      filtering - An instance of the component to be filtered. The component specified here must implement the interface FilterBarFiltering.
  • Method Details

    • setCriteria

      public TextFilter setCriteria(Criteria criteria)
      Sets the criterion for text filter component. You can only specify a simple criterion with a LIKE operator. The method throws an exception for any other criteria.
      Specified by:
      setCriteria in class JBBaseFilter<TextFilter>
      Parameters:
      criteria - Filter criterion If null is specified, the text filter component is reset to default
      Returns:
      Text filter component
      Throws:
      IllegalArgumentException - Thrown if the specified criterion is a complex criterion or does not contain a LIKE operator
    • setWorldOperator

      public TextFilter setWorldOperator(OperatorType type)
      Sets the operator between the words of the search term you entered. By default, words are included in the words when the user searches for a multi-word phrase
      Parameters:
      type - The operator that appears in the words. By default AND. You can use the AND or OR operator of the OperatorType enum values
      Returns:
      Text filter component
    • getWorldOperator

      public OperatorType getWorldOperator()
      Query the operator in the search term
      Returns:
      The operator in the words of the search word
    • setFilteredColumns

      public TextFilter setFilteredColumns(String... columns)
      Set the columns in the filter
      By default, the filter includes all visible columns of type TEXT from the DataDescriptor. If you set the columns in the filter, only the columns specified here will be included in the criteria.
      Only columns of type TEXT in the DataDescriptor can be set with this method, all other types of columns will be ignored.
      Parameters:
      columns - The filterable column list
      Returns:
      The filter component
    • getFilteredColumnNames

      public List<String> getFilteredColumnNames()
      Gets column names in the filter
      Returns:
      The list of filterable column names