|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.views.properties.PropertySheetSorter
Class used by PropertySheetPage
to
sort properties.
The default implementation sorts alphabetically. Subclasses may overwrite to implement custom sorting.
Constructor Summary | |
---|---|
PropertySheetSorter()
Creates a new sorter, which uses the default collator to sort strings. |
|
PropertySheetSorter(Collator collator)
Creates a new sorter, which uses the given collator to sort strings. |
Method Summary | |
---|---|
int |
compare(IPropertySheetEntry entryA,
IPropertySheetEntry entryB)
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element. |
int |
compareCategories(String categoryA,
String categoryB)
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element. |
protected Collator |
getCollator()
Returns the collator used to sort strings. |
void |
sort(IPropertySheetEntry[] entries)
Sorts the given elements in-place, modifying the given array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertySheetSorter()
public PropertySheetSorter(Collator collator)
collator
- the collator to use to sort stringsMethod Detail |
public int compare(IPropertySheetEntry entryA, IPropertySheetEntry entryB)
The default implementation of this method uses the collator to compare the display names. Subclasses may override.
entryA
- the first elemententryB
- the second element
0
if the first element is equal
to the second element; and a positive number if the first element
is greater than the second elementpublic int compareCategories(String categoryA, String categoryB)
The default implementation of this method uses the collator to compare the strings. Subclasses may override.
categoryA
- the first elementcategoryB
- the second element
0
if the first element is equal
to the second element; and a positive number if the first element
is greater than the second elementprotected Collator getCollator()
public void sort(IPropertySheetEntry[] entries)
The default implementation of this method uses the java.util.Arrays#sort
algorithm on the given array, calling compare
to compare
elements.
Subclasses may reimplement this method to provide a more optimized implementation.
entries
- the elements to sort
|
Eclipse Platform Release 3.1 |
|||||||||||
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, 2005. All rights reserved.