|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jface.viewers.ViewerComparator
org.eclipse.jface.viewers.ViewerSorter
A viewer sorter is used by a StructuredViewer
to reorder the elements
provided by its content provider.
The default compare
method compares elements using two steps.
The first step uses the values returned from category
.
By default, all elements are in the same category.
The second level is based on a case insensitive compare of the strings obtained
from the content viewer's label provider via ILabelProvider.getText
.
Subclasses may implement the isSorterProperty
method;
they may reimplement the category
method to provide
categorization; and they may override the compare
methods
to provide a totally different way of sorting elements.
It is recommended to use ViewerComparator
instead.
IStructuredContentProvider
,
StructuredViewer
Field Summary | |
---|---|
protected Collator |
collator
The collator used to sort strings. |
Constructor Summary | |
---|---|
ViewerSorter()
Creates a new viewer sorter, which uses the default collator to sort strings. |
|
ViewerSorter(Collator collator)
Creates a new viewer sorter, which uses the given collator to sort strings. |
Method Summary | |
---|---|
Collator |
getCollator()
Returns the collator used to sort strings. |
protected Comparator |
getComparator()
Returns the comparator used to sort strings. |
Methods inherited from class org.eclipse.jface.viewers.ViewerComparator |
---|
category, compare, isSorterProperty, sort |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Collator collator
Constructor Detail |
public ViewerSorter()
public ViewerSorter(Collator collator)
collator
- the collator to use to sort stringsMethod Detail |
public Collator getCollator()
protected Comparator getComparator()
ViewerComparator
getComparator
in class ViewerComparator
|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.