g-Eclipse
Release 1.0.0

eu.geclipse.ui.comparators
Class TreeColumnComparator

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

public class TreeColumnComparator
extends ViewerComparator

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


Constructor Summary
TreeColumnComparator(TreeColumn defaultSortColumn)
          Construct a ViewerComparator to use for a TreeViewer, 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

TreeColumnComparator

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

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