net.sourceforge.java.util.gui.jface.viewers
Class TreeViewerSorter

java.lang.Object
  extended byorg.eclipse.jface.viewers.ViewerComparator
      extended byorg.eclipse.jface.viewers.ViewerSorter
          extended bynet.sourceforge.java.util.gui.jface.viewers.TreeViewerSorter

public class TreeViewerSorter
extends ViewerSorter

Default sorter for use in JFace TreeViewer instances based on ITreeElement structures.

Author:
Sebastian Machhausen

Field Summary
 
Fields inherited from class org.eclipse.jface.viewers.ViewerSorter
collator
 
Fields inherited from class org.eclipse.jface.viewers.ViewerComparator
 
Constructor Summary
TreeViewerSorter()
           
 
Method Summary
 int category(Object element)
           Returns the category of the given element.
 
Methods inherited from class org.eclipse.jface.viewers.ViewerSorter
getCollator, getComparator
 
Methods inherited from class org.eclipse.jface.viewers.ViewerComparator
compare, isSorterProperty, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeViewerSorter

public TreeViewerSorter()
Method Detail

category

public int category(Object element)

Returns the category of the given element. The category is a number used to allocate elements to bins; the bins are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort criterion.

If the specified element is an ITreeElement and allows sub elements this method returns 0 otherwise 1 as bin number.

Parameters:
element - the element to get the category bin number for
Returns:
the category bin number