java.lang.Object
org.eclipse.jface.viewers.ViewerSorter
com.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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
AnnotationSorter
public AnnotationSorter(java.lang.String sortkey)
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)