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

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

public class TableTreeViewerSorter
extends TableViewerSorter

Generic ViewerSorter extension for TreeViewer instances using ITableContentProvider implementations based on ITreeElement structures.

Author:
Sebastian Machhausen

Field Summary
 
Fields inherited from class net.sourceforge.java.util.gui.jface.viewers.TableViewerSorter
 
Fields inherited from class org.eclipse.jface.viewers.ViewerSorter
collator
 
Fields inherited from class org.eclipse.jface.viewers.ViewerComparator
 
Constructor Summary
TableTreeViewerSorter(Viewer viewer, ITableContentProvider contentProvider)
           Creates a new TableTreeViewerSorter instance linked to the specified Viewer.
 
Method Summary
 int category(Object element)
           Returns the category of the given element.
 
Methods inherited from class net.sourceforge.java.util.gui.jface.viewers.TableViewerSorter
compare, getSortingColumn, isAscending, setAscending, setSortingColumn, sort
 
Methods inherited from class org.eclipse.jface.viewers.ViewerSorter
getCollator, getComparator
 
Methods inherited from class org.eclipse.jface.viewers.ViewerComparator
isSorterProperty, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableTreeViewerSorter

public TableTreeViewerSorter(Viewer viewer,
                             ITableContentProvider contentProvider)

Creates a new TableTreeViewerSorter instance linked to the specified Viewer.

Parameters:
viewer - the Viewer to link this TableTreeViewerSorter to
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