|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.odell.glazedlists.gui.AbstractTableComparatorChooser<E>
ca.odell.glazedlists.swt.TableComparatorChooser<E>
public final class TableComparatorChooser<E>
A TableComparatorChooser is a tool that allows the user to sort a ListTable by clicking on the table's headers. It requires that the ListTable has a SortedList as a source as the sorting on that list is used.
Field Summary |
---|
Fields inherited from class ca.odell.glazedlists.gui.AbstractTableComparatorChooser |
---|
MULTIPLE_COLUMN_KEYBOARD, MULTIPLE_COLUMN_MOUSE, MULTIPLE_COLUMN_MOUSE_WITH_UNDO, SINGLE_COLUMN, sortedList, sortedListComparator, sortingState |
Constructor Summary | |
---|---|
TableComparatorChooser(DefaultEventTableViewer<E> eventTableViewer,
SortedList<E> sortedList,
boolean multipleColumnSort)
Deprecated. replaced with install(ca.odell.glazedlists.swt.DefaultEventTableViewer , which is functionally
identical but uses a more fitting name to convey the action that is
performed. |
Method Summary | ||
---|---|---|
void |
addSortListener(org.eclipse.swt.widgets.Listener sortListener)
Registers the specified Listener to receive notification whenever
the Table is sorted by this TableComparatorChooser . |
|
void |
dispose()
Releases the resources consumed by this TableComparatorChooser so that it
may eventually be garbage collected. |
|
static
|
install(DefaultEventTableViewer<E> eventTableViewer,
SortedList<E> sortedList,
boolean multipleColumnSort)
Installs a new TableComparatorChooser that responds to clicks on the specified table and uses them to sort the specified list. |
|
protected void |
rebuildComparator()
Updates the comparator in use and applies it to the table. |
|
void |
removeSortActionListener(org.eclipse.swt.widgets.Listener sortListener)
Deregisters the specified Listener to no longer receive events. |
|
protected void |
updateTableSortColumn()
Updates the SWT table to indicate sorting icon on the primary sort column. |
Methods inherited from class ca.odell.glazedlists.gui.AbstractTableComparatorChooser |
---|
appendComparator, clearComparator, createComparatorForElement, createSortingState, fromString, getColumnComparatorIndex, getComparatorsForColumn, getSortingColumns, getSortingStyle, isColumnReverse, redetectComparator, setTableFormat, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TableComparatorChooser(DefaultEventTableViewer<E> eventTableViewer, SortedList<E> sortedList, boolean multipleColumnSort)
install(ca.odell.glazedlists.swt.DefaultEventTableViewer, ca.odell.glazedlists.SortedList, boolean)
, which is functionally
identical but uses a more fitting name to convey the action that is
performed.
Method Detail |
---|
public static <E> TableComparatorChooser<E> install(DefaultEventTableViewer<E> eventTableViewer, SortedList<E> sortedList, boolean multipleColumnSort)
eventTableViewer
- the table viewer for the table to be sortedsortedList
- the sorted list to update.multipleColumnSort
- true
to sort by multiple columns
at a time, or false
to sort by a single column. Although
sorting by multiple columns is more powerful, the user interface is
not as simple and this strategy should only be used where necessary.public void addSortListener(org.eclipse.swt.widgets.Listener sortListener)
Listener
to receive notification whenever
the Table
is sorted by this TableComparatorChooser
.
public void removeSortActionListener(org.eclipse.swt.widgets.Listener sortListener)
Listener
to no longer receive events.
protected final void updateTableSortColumn()
protected final void rebuildComparator()
This method is called when the sorting state changed.
rebuildComparator
in class AbstractTableComparatorChooser<E>
public void dispose()
TableComparatorChooser
so that it
may eventually be garbage collected.
A TableComparatorChooser
will be garbage collected without a call to
dispose()
, but not before its source EventList
is garbage
collected. By calling dispose()
, you allow the TableComparatorChooser
to be garbage collected before its source EventList
. This is
necessary for situations where an TableComparatorChooser
is short-lived but
its source EventList
is long-lived.
Warning: It is an error
to call any method on a TableComparatorChooser
after it has been disposed.
dispose
in class AbstractTableComparatorChooser<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |