Enum Class FilterType
- All Implemented Interfaces:
Serializable
,Comparable<FilterType>
,Constable
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 name | Description | Default |
---|---|---|
type | The filter type, that will have the parameters applied to it. The applicable values are this enum's values. | Applies to every filter |
name | Custrom filter component's name | null |
FilterClassAdapter | The class containing the implementation of the custom filter component. | null |
editorType | The 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 |
defaultOperator | The filter's default operator. For applicable values, see the OperatorType enum | |
wildCard | If it's a text column, a custom wildcard character can be specified here. | * |
operators | The 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 |
params | The input field's parameters. For applicable values see the EditorType enum | The field editor parameters. |
values | The 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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAdaptive filter (inline filter)Advanced filterCustom filter componentNo filterSimple filterText filter -
Method Summary
Modifier and TypeMethodDescriptionstatic FilterType
Determines the filter type by the filter nameClass<? extends BaseFilter<?>>
Gets the class that implements the filter componentGets the filter java script namegetName()
Gets the filter type namestatic FilterType
Returns the enum constant of this class with the specified name.static FilterType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No filter
The list cannot be filtered by the user
-
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
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
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
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
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
className used in the DataDescriptor: "custom"
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getName
Gets the filter type name- Returns:
- The filter type name
-
getFilterClass
Gets the class that implements the filter component- Returns:
- The class that implements the filter component
-
fromName
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
Gets the filter java script name- Returns:
- The filter java script name or null, if java script is not supported the filter
-