- Type Parameters:
T- the column type
- All Superinterfaces:
- All Known Subinterfaces:
- All Known Implementing Classes:
public interface GColumnRenderer<T> extends javax.swing.table.TableCellRendererAn interface for the
DynamicTableColumn. This allows the filtering system to stay in sync with the rendering system by using the display text to filter.
Table filtering in
GTables typically works with the following setup:
- The table has a text field that allows for quick filtering across all visible
columns. The specifics of how the text filter works are defined by the
RowFilterTransformer, which is controlled by the user via the button at the right of the filter field. (In the absence of this button, filters are typically a 'contains' filter.
The default transformer turns items to strings by, in order,:
The table has the ability to perform advanced filtering based upon specific columns. Each
column's type is used to find dynamically discovered
ColumnConstraints. These constraints dictate how a given column can be filtered. The user will create filters using these constraints in the
ColumnFilterDialogby pressing the button at the far right of the filter text field.
- Any custom filters, defined by individual clients (this is outside the scope of the default filtering system)
Nested Class Summary
Nested Classes Modifier and Type Interface Description
GColumnRenderer.ColumnConstraintFilterModeAn enum that signals how the advanced column filtering should work.
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description
createWrapperTypeException()A convenience method for primitive-based/wrapper-based renderers to signal that they should not be using text to filter.
getColumnConstraintFilterMode()Returns the current mode of how column constraints will be used to filter this column
getFilterString(T t, Settings settings)Returns a string that is suitable for use when filtering.
default GColumnRenderer.ColumnConstraintFilterMode getColumnConstraintFilterMode()Returns the current mode of how column constraints will be used to filter this column
This method is typically not overridden. This is only needed in rare cases, such as when a column uses a renderer, but does *not* want this column to be filtered using a String column constraint. Or, if a column uses a renderer and wants that text to be available as a filter, along with any other column constraints.
- the mode
getFilterStringReturns a string that is suitable for use when filtering. The returned String should be an unformatted (e.g., no HTML markup, icons, etc) version of what is on the screen. If the String returned here does not match what the user sees (that which is rendered), then the filtering action may confuse the user.
t- the column type instance
settings- any settings the converter may need to convert the type
- the unformatted String version of what is rendered in the table cell on screen
default AssertException createWrapperTypeException()A convenience method for primitive-based/wrapper-based renderers to signal that they should not be using text to filter.
The basic wrapper types, like Number, and some others, like
Date, have special built-in filtering capabilities. Columns whose column type is one of the wrapper classes will not have their
getFilterString(Object, Settings)methods called. They can stub out those methods by throwing the exception returned by this method.
- the new exception
- See Also: