|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.odell.glazedlists.swing.EventListJXTableSorting
public class EventListJXTableSorting
Sort a JXTable using SortedList.
| Extension: SwingX | |
| This Glazed Lists extension requires the third party library SwingX. | |
| Tested Version: | CVS Head, September 18, 2006 |
| Home page: | https://swingx.dev.java.net/ |
| License: | LGPL |
To prepare a JXTable to be sorted using a SortedList:
SortedList and AdvancedTableModel that depends
on that SortedList.
JXTable using the AdvancedTableModel as its model.
install(org.jdesktop.swingx.JXTable, ca.odell.glazedlists.SortedList) method to bind the
JXTable's headers to the SortedList's Comparator.
Note that your FilterPipeline will be changed as a consequence of
using EventListJXTableSorting. This is due to API limitations in
SwingX which will hopefully be eventually resolved. For this reason it is
recommended that you not use FilterPipeline with this class. Instead,
consider using FilterList for filtering your JXTable.
Since this class works with the SwingX project, it is likely to change as SwingX continues to evolve and mature. We will attempt to maintain source and binary compatibility as SwingX changes, but it is highly recommended that you test your table sorting each time you update your SwingX jar file.
The behaviour of multiple column sorting in JXTable is not particularly
flexible. For different configuration options, consider using a
TableComparatorChooser instead of EventListJXTableSorting.
To do this, you'll first need to disable the JXTable's built-in sorting
and restore the standard header renderer:
JXTable table = ...
table.setSortable(false);
table.getTableHeader().setDefaultRenderer(new JTableHeader().getDefaultRenderer());
| Method Summary | |
|---|---|
static EventListJXTableSorting |
install(JXTable table,
SortedList sortedList)
Install this EventListJXTableSorting to provide the sorting behaviour for the
specified JXTable. |
static EventListJXTableSorting |
install(JXTable table,
SortedList sortedList,
Comparator defaultComparator)
Install this EventListJXTableSorting to provide the sorting behaviour for the
specified JXTable. |
void |
setMultipleColumnSort(boolean multipleColumnSort)
Toggle whether clicked columns will be sorted after other sorted columns (ie. break ties), or whether they will be come the exclusive sorted column. |
void |
uninstall()
Remove this EventListJXTableSorting from the JXTable and restores the
original filter pipeline. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static EventListJXTableSorting install(JXTable table, SortedList sortedList)
EventListJXTableSorting to provide the sorting behaviour for the
specified JXTable. No comparator is used, when there are no sort keys.
public static EventListJXTableSorting install(JXTable table, SortedList sortedList, Comparator defaultComparator)
EventListJXTableSorting to provide the sorting behaviour for the
specified JXTable. Optionally, a default comparator can be specified, which is
used, when there are no sort keys.
public void setMultipleColumnSort(boolean multipleColumnSort)
The default behaviour of JXTable multiple column sorting is that each
click appends a column to the sorting columns, reversing that column
if it's already sorting. Clearing the sorting columns is done by holding
SHIFT and clicking on a column header.
public void uninstall()
EventListJXTableSorting from the JXTable and restores the
original filter pipeline.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||