view.mailBoxView.util
Class ArticleViewerSorter

java.lang.Object
  extended by org.eclipse.jface.viewers.ViewerSorter
      extended by view.mailBoxView.util.ArticleViewerSorter

public class ArticleViewerSorter
extends org.eclipse.jface.viewers.ViewerSorter

This class implements the sorting for the article table in the mail view

Author:
pgroudas

Field Summary
private static int ASCENDING
           
private  int column
           
private static int DESCENDING
           
private  int direction
           
 
Fields inherited from class org.eclipse.jface.viewers.ViewerSorter
collator
 
Constructor Summary
ArticleViewerSorter()
           
 
Method Summary
 int compare(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object e1, java.lang.Object e2)
          Compares the object for sorting
 void doSort(int column)
          Does the sort.
 
Methods inherited from class org.eclipse.jface.viewers.ViewerSorter
category, getCollator, isSorterProperty, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASCENDING

private static final int ASCENDING
See Also:
Constant Field Values

DESCENDING

private static final int DESCENDING
See Also:
Constant Field Values

column

private int column

direction

private int direction
Constructor Detail

ArticleViewerSorter

public ArticleViewerSorter()
Method Detail

doSort

public void doSort(int column)
Does the sort. If it's a different column from the previous sort, do an ascending sort. If it's the same column as the last sort, toggle the sort direction.

Parameters:
column -

compare

public int compare(org.eclipse.jface.viewers.Viewer viewer,
                   java.lang.Object e1,
                   java.lang.Object e2)
Compares the object for sorting

Overrides:
compare in class org.eclipse.jface.viewers.ViewerSorter
Parameters:
viewer - Viewer
e1 - Object
e2 - Object
Returns:
int