Enum Class FilterType

java.lang.Object
java.lang.Enum<FilterType>
com.jbstrap.core.meta.enums.FilterType
All Implemented Interfaces:
Serializable, Comparable<FilterType>, Constable

public enum FilterType extends Enum<FilterType>

Filter types that can be used when displaying a list.

The filter types can be specified in the DataDescriptor. To do this, among the parameters of the DataDescriptor, a "defaultFilterType" attribute has to be specified, and it's value can be one of the filter types listed below.

If the filter is to be parameterized on each column, this can be done with each separate column's parameters. If you want to set if the columns can be filtered, then a "filterable" attribute must be assigned to the column attributes. If that attribute is set to true, this functionality is enabled. The default value is true. The column's filter settings can be defined (general and by type) by using the column's "filters" tag. In the tag, multiple "filter" tags can be specified, for each filter type. The parameters that can be used in the tag are the following:

Attribute nameDescriptionDefault
typeThe filter type, that will have the parameters applied to it. The applicable values are this enum's values.Applies to every filter
nameCustrom filter component's namenull
FilterClassAdapterThe class containing the implementation of the custom filter component. null
editorTypeThe type of the input field that is used to set the value of the filter. The same type of editor that is used to edit the column
defaultOperatorThe filter's default operator. For applicable values, see the OperatorType enum
  • If it's a text column: LINK
  • If the column contains multiple values: IN_SET
  • In any other case: EQUALS
wildCardIf it's a text column, a custom wildcard character can be specified here.*
operatorsThe operators that the user can choose when defining a filter. The usable operators have to be specified in the "operator" tags Every operator that are applicable to the column's type
paramsThe input field's parameters. For applicable values see the EditorType enum The field editor parameters.
valuesThe values that are used for filtering. (Used if the field can be filtered based on a set of values, and the set is static and differs from the set that is used when modifying the field). The values used for modifying the field

Since:
4.0
Author:
JBStrap
See Also:
  • Enum Constant Details

    • NONE

      public static final FilterType NONE

      No filter

      The list cannot be filtered by the user

    • ADAPTIVE_FILTER

      public static final FilterType ADAPTIVE_FILTER

      Adaptive filter (inline filter)

      If this filter type is used, the input field will appear between the header and the list. The value inputted in this field will be used as the filter. If multiple columns have values in them, the filters will be connected with an AND connector

      Name used in the DataDescriptor: "adaptiveFilter"

    • SIMPLE_FILTER

      public static final FilterType SIMPLE_FILTER

      Simple filter

      A simple filter criteria. With this, the list can only be filtered to a single column. If this filter is used, then the filtering row will appear above the list, and the filter can be specified there. This row will have a dropdown menu, where the user can choose which column will be filtered. Then the user can chose the operator. After that, an input field, (corresponding to the column type) will appear, where the filter value can be specified

      If the user wants to filter a column, that is built from a set of values, then the value specifying field will use the same values (this will be queried by the system automatically from the database).

      At the end of the row, two buttons will be displayed, that the user can use to execute the filter, or delete a previous one.

      Name used in the DataDescriptor: "simpleFilter"

      See Also:
    • ADVANCED_FILTER

      public static final FilterType ADVANCED_FILTER

      Advanced filter

      The user can specify an advanced, more complex filter.With this, the list can only be filtered to a single column. If this filter is used, then the filtering row will appear above the list, and the filter can be specified there. This row will have a dropdown menu, where the user can choose which column will be filtered. Then the user can chose the operator. After that, an input field, (corresponding to the column type) will appear, where the filter value can be specified After the value input field, two buttons will be displayed, these are used to apply an AND connection with the AND button. With the or button, an OR connection can be added. If the or button is pressed, another line will be added to the filter.

      The previously defined filters will be under the editor. Filters in the same row will be connected with an AND connection, and filters in another row will be connected with an OR connnection. The filters that were previously defined can be deleted, edited, negated or turned off by the user. These operations can be applied simultaneously to every filter in the same row.

      At the end of the row, two buttons will be displayed, that the user can use to execute the filter, or delete a previous one.

      Name used in the DataDescriptor: "advancedFilter"

      See Also:
    • TEXT_FILTER

      public static final FilterType TEXT_FILTER

      Text filter

      This can be only applied to text columns. When used, an input field and filter button will be displayed above the list. The text inputted in the input field will be used when filtering. When executing the filtering, every column that contains the inputted text will pass the filter, and they will be displayed.

      Name used in the DataDescriptor: "textFilter"

      See Also:
    • CUSTOM

      public static final FilterType CUSTOM

      Custom filter component

      This is used, in the case of custom filters, that are not included in the framework. The custom implementation must extend from the BaseFilter class

      Name used in the DataDescriptor: "custom"

  • Method Details

    • values

      public static FilterType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FilterType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()
      Gets the filter type name
      Returns:
      The filter type name
    • getFilterClass

      public Class<? extends BaseFilter<?>> getFilterClass()
      Gets the class that implements the filter component
      Returns:
      The class that implements the filter component
    • fromName

      public static FilterType fromName(String name)
      Determines the filter type by the filter name
      Parameters:
      name - The name of the filter type
      Returns:
      The specified filter type or null, if not found
    • getFilterName

      public String getFilterName()
      Gets the filter java script name
      Returns:
      The filter java script name or null, if java script is not supported the filter