Overriden default behaviour
There are two possibilities to alter the default behaviour of the library: using system properties, or, for some of these properties, defining specific settings.
Using system properties
The filter has some built-in default behaviour. For example, the header is placed by default inline, the text parser is case-sensitive and so on.
Users can modify this default behavior by overriden system properties. There are such properties for most aspects, including all the strings visualized by the library. The main properties are:
- net.coderazzi.filters.TextParser.class: (since version 2.1.2): defines the class used by default as TextParser. It must subclass IFilterTextParser and define a default constructor
- net.coderazzi.filters.TableFilter.AutoSelection: (since version 2.1): true by default; if the filter expression would select just one row in the table, that row is automatically selected. Likewise, selected rows that are filtered out are automatically de-selected.
- net.coderazzi.filters.Header.Mode: the default editor mode (SLIM, BASIC, CHOICE). By default is BASIC.
- net.coderazzi.filters.Header.Position: whether the header must be placed by default on TOP or INLINE. By default is INLINE.
- net.coderazzi.filters.TextParser.IgnoreCase: if the filter text parsers must be case sensitive or not. By default, parsing is case sensitive.
- net.coderazzi.filters.TextParser.DateFormat: the default date format when the user writes a date on a text filter. By default it corresponds to the java SHORT date format for the current locale.
- net.coderazzi.filters.TextParser.CompareDateAsRendered: set to true to use the built-in date comparison. See here to understand this delicate point. By default, it is set to false.
- net.coderazzi.filters.TextParser.BooleanFalse: the string associated to the boolean value false.
- net.coderazzi.filters.TextParser.BooleanTrue: the string associated to the boolean value true.
The example on properties allows to play with these properties, before applying them to a typical table filter program.
Using TableFilter settings
The TableFilter class defines a singleton, of type TableFilter.Settings which facilitates the definition of the most common properties: autoSelection, case sensitivity, and the default header's mode and position, as well as the class defining the default IFilterTextParser implementation.
Please note that this class is a simple wrapper around the system properties.