|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.RowFilter
net.coderazzi.filters.BaseFilter
net.coderazzi.filters.ComposedFilter
net.coderazzi.filters.AndFilter
net.coderazzi.filters.TableFilter
public class TableFilter
TableFilter represents a RowFilter
instance that can be attached to a
JTable
to compose dynamically the outcome of one or more filter editors. As
such, it is a dynamic filter, which updates the table when there are changes in any of the
composed sub filters.
Users require instancing TableFilter instances only when managing their own filter editors.
Note that the TableFilterHeader
already handles its own
TableFilter, and keeps track of any table changes, updating automatically the editors.
When users instanciate directly TableFilter objects, care must be taken to update the associated editors when the table model changes.
In Java 6, a filter is automatically associated to a RowSorter
, so
JTable
instances with a TableFilter must define their own
RowSorter
. Being this not the case, the TableFilter will automatically set
the default RowSorter
in that table. That is, tables with a TableFilter will
always have sorting enabled.
The RowSorter
interface does not support filtering capabilities, which are
only enabled via the DefaultRowSorter
class. If the registered table uses any
sorter that does not subclass the DefaultRowSorter
class, the TableFilter
will perform no filtering at all.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.RowFilter |
---|
RowFilter.ComparisonType, RowFilter.Entry<M,I> |
Field Summary |
---|
Fields inherited from class net.coderazzi.filters.ComposedFilter |
---|
filters |
Fields inherited from class net.coderazzi.filters.BaseFilter |
---|
filterObservers |
Constructor Summary | |
---|---|
TableFilter()
Default constructor |
|
TableFilter(JTable table)
Basic constructor, setting directly the controlled table |
Method Summary | |
---|---|
boolean |
enableNotifications(boolean enable)
Temporarily enable/disable notifications to the observers, including the registered JTable . |
JTable |
getTable()
Returns the associated table |
boolean |
isAutoSelection()
Returns the autoselection mode |
void |
sendPendingNotifications()
Method to force the sending of notifications, even if they are currently temporarily disabled. |
void |
setAutoSelection(boolean enable)
Sets the autoselection mode |
void |
setTable(JTable table)
Method to set the associated table. |
Methods inherited from class net.coderazzi.filters.AndFilter |
---|
include |
Methods inherited from class net.coderazzi.filters.ComposedFilter |
---|
addFilter, detach, filterUpdated, getFilterObservables, removeFilter |
Methods inherited from class net.coderazzi.filters.BaseFilter |
---|
addFilterObserver, getFilterObservers, removeFilterObserver, reportFilterUpdatedToObservers |
Methods inherited from class javax.swing.RowFilter |
---|
andFilter, dateFilter, notFilter, numberFilter, orFilter, regexFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableFilter()
public TableFilter(JTable table)
Method Detail |
---|
public void setTable(JTable table)
RowSorter
, the default one is automatically created.
public JTable getTable()
public boolean enableNotifications(boolean enable)
Temporarily enable/disable notifications to the observers, including the registered
JTable
.
Multiple calls to this method can be issued, but the caller must ensure that there are as many calls with true parameter as with false parameter, as the notifications are only re-enabled when the zero balance is reached.
public void sendPendingNotifications()
Method to force the sending of notifications, even if they are currently temporarily disabled.
Note that, in any case, the update notification is only sent if there is any pending notifications.
public void setAutoSelection(boolean enable)
if autoSelection is true, if there is only one possible row to select on the table, it will be selected.
public boolean isAutoSelection()
setAutoSelection(boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |