Examples

The source distribution of the library includes several swing applications:

These applications are used as tests, but also as example source code.

The first application can be downloaded and executed directly (it uses the Java 6 version).

AppTestMain.java

This example shows the following functionality:

When the expanded table is shown, with all the columns, the name column includes, if the editor is in parsing text mode, a regular expression parser (all the other columns include the default parser).

AppTestWithSeparatedComponents.java

This is a basic example showing the composition of multiple filters on standalone mode.

AppTestComplex.java

This is a more complex example showing the composition of multiple filters, using standalone mode and the generic header.

It includes as well and additional feature: although the table contains only 5 columns, filters can be used with additional variables, or identifiers. For example, the table does not contain a club column, but the filter in the previous figure is using the club value associated to each row to specify a condition.

There are several ways to implement this feature. In the example, it is implemented by implementing an extended TableModel which has only the initial 5 columns visible, but provides information on additional fields for each row. The other way to implement this feature is by setting a specialized TableFilter that overrides the include method to pass a different RowFilter.Entry instance to the filters, implementing an extending dictionary.

AppUserFilter.java

Very simple example, showing how to define user filters.

ChoiceEditorUpdatesTest.java

Test program to show how to listen to events on the table editors, and how the TableChoiceFilterEditor is automatically updated when the table updates its contents.

AppTestProperties.java

Application to show how defining system properties modifies the behaviour of the TableFilter. Please note that, to define the same properties on an application, all properties must be prepended with "net.coderazzi.filters."