Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.eclipse.jdt.annotation
Class AnnotationSorter  view AnnotationSorter download AnnotationSorter.java

java.lang.Object
  extended byorg.eclipse.jface.viewers.ViewerSorter
      extended bycom.port80.eclipse.jdt.annotation.AnnotationSorter

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

Sort annotation entries according to prefered keys. Current valid keys are "Name", "Path", "Annotation", "AccessTime", "CreateTime", "Count". AccessTime, CreateTime and Count is sorted numerically larger first.


Field Summary
static int ACCESSTIME
           
static int ANNOTATION
           
static int COUNT
           
static int CREATETIME
           
static java.lang.String DEF_SORTKEY
           
private  int fSortBy
           
static int NAME
           
static int PATH
           
static java.util.Map SORTKEYMAP
           
static java.lang.String[] SORTKEYS
           
 
Fields inherited from class org.eclipse.jface.viewers.ViewerSorter
collator
 
Constructor Summary
AnnotationSorter(java.lang.String sortkey)
           
 
Method Summary
 int category(java.lang.Object element)
          Returns the category of the given element.
private  int compare(java.lang.String name1, java.lang.String name2)
           
 int compare(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object e1, java.lang.Object e2)
          Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.
(package private)  void setSortKey(java.lang.String sortkey)
           
 
Methods inherited from class org.eclipse.jface.viewers.ViewerSorter
getCollator, isSorterProperty, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_SORTKEY

public static final java.lang.String DEF_SORTKEY
See Also:
Constant Field Values

SORTKEYMAP

public static final java.util.Map SORTKEYMAP

SORTKEYS

public static final java.lang.String[] SORTKEYS

NAME

public static final int NAME
See Also:
Constant Field Values

PATH

public static final int PATH
See Also:
Constant Field Values

ANNOTATION

public static final int ANNOTATION
See Also:
Constant Field Values

CREATETIME

public static final int CREATETIME
See Also:
Constant Field Values

ACCESSTIME

public static final int ACCESSTIME
See Also:
Constant Field Values

COUNT

public static final int COUNT
See Also:
Constant Field Values

fSortBy

private int fSortBy
Constructor Detail

AnnotationSorter

public AnnotationSorter(java.lang.String sortkey)
Method Detail

category

public int category(java.lang.Object element)
Description copied from class: org.eclipse.jface.viewers.ViewerSorter
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.

The default implementation of this framework method returns 0. Subclasses may reimplement this method to provide non-trivial categorization.


compare

public int compare(org.eclipse.jface.viewers.Viewer viewer,
                   java.lang.Object e1,
                   java.lang.Object e2)
Description copied from class: org.eclipse.jface.viewers.ViewerSorter
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.

The default implementation of this method is based on comparing the elements' categories as computed by the category framework method. Elements within the same category are further subjected to a case insensitive compare of their label strings, either as computed by the content viewer's label provider, or their toString values in other cases. Subclasses may override.


setSortKey

void setSortKey(java.lang.String sortkey)

compare

private int compare(java.lang.String name1,
                    java.lang.String name2)