g-Eclipse
Release 1.0.0

eu.geclipse.ui.comparators
Class TableColumnComparator

java.lang.Object
  extended by ViewerComparator
      extended by eu.geclipse.ui.comparators.TableColumnComparator

public class TableColumnComparator
extends ViewerComparator

This comparator is used to sort the table entries according to the selected sorting column, with a second ordering column as fallback if entries compare equal.


Constructor Summary
TableColumnComparator(TableColumn defaultSortColumn)
          Construct a ViewerComparator to use for a TableViewer, with the given column as fallback sorting column.
 
Method Summary
 int category(java.lang.Object element)
           
 int compare(Viewer viewer, java.lang.Object element1, java.lang.Object element2)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableColumnComparator

public TableColumnComparator(TableColumn defaultSortColumn)
Construct a ViewerComparator to use for a TableViewer, with the given column as fallback sorting column. Remark that each TableViewer needs a new instance of this TableColumnComparator.

Parameters:
defaultSortColumn - The sorting column used as fallback if elements compare equal.
Method Detail

category

public int category(java.lang.Object element)

compare

public int compare(Viewer viewer,
                   java.lang.Object element1,
                   java.lang.Object element2)

g-Eclipse
Release 1.0.0