ca.odell.glazedlists.swt
Class TableComparatorChooser

java.lang.Object
  extended by ca.odell.glazedlists.gui.AbstractTableComparatorChooser
      extended by ca.odell.glazedlists.swt.TableComparatorChooser

public final class TableComparatorChooser
extends AbstractTableComparatorChooser

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.

Warning: This class is a a developer preview and subject to many bugs and API changes.

Author:
Jesse Wilson
See Also:
Snippet 2

Field Summary
 
Fields inherited from class ca.odell.glazedlists.gui.AbstractTableComparatorChooser
MULTIPLE_COLUMN_KEYBOARD, MULTIPLE_COLUMN_MOUSE, SINGLE_COLUMN, sortedList, sortedListComparator, sortingState
 
Constructor Summary
TableComparatorChooser(EventTableViewer eventTableViewer, SortedList sortedList, boolean multipleColumnSort)
          Creates a new TableComparatorChooser that responds to clicks on the specified table and uses them to sort the specified list.
 
Method Summary
 void addSortListener(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.
protected  void rebuildComparator()
          Updates the comparator in use and applies it to the table.
 void removeSortActionListener(Listener sortListener)
          Deregisters the specified Listener to no longer receive events.
 
Methods inherited from class ca.odell.glazedlists.gui.AbstractTableComparatorChooser
appendComparator, clearComparator, createComparatorForElement, 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

TableComparatorChooser

public TableComparatorChooser(EventTableViewer eventTableViewer,
                              SortedList sortedList,
                              boolean multipleColumnSort)
Creates a new TableComparatorChooser that responds to clicks on the specified table and uses them to sort the specified list.

Parameters:
eventTableViewer - the table viewer for the table to be sorted
sortedList - 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.
Method Detail

addSortListener

public void addSortListener(Listener sortListener)
Registers the specified Listener to receive notification whenever the Table is sorted by this TableComparatorChooser.


removeSortActionListener

public void removeSortActionListener(Listener sortListener)
Deregisters the specified Listener to no longer receive events.


rebuildComparator

protected final void rebuildComparator()
Updates the comparator in use and applies it to the table.

Overrides:
rebuildComparator in class AbstractTableComparatorChooser

dispose

public void dispose()
Releases the resources consumed by this 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.

Overrides:
dispose in class AbstractTableComparatorChooser


Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by jessewilson at 2006-08-09 23:05