|
Lines 11-17
Link Here
|
| 11 |
package org.eclipse.jface.viewers; |
11 |
package org.eclipse.jface.viewers; |
| 12 |
|
12 |
|
| 13 |
import java.text.Collator; // can't use ICU - Collator used in public API |
13 |
import java.text.Collator; // can't use ICU - Collator used in public API |
| 14 |
import java.util.Comparator; |
|
|
| 15 |
|
14 |
|
| 16 |
/** |
15 |
/** |
| 17 |
* A viewer sorter is used by a {@link StructuredViewer} to reorder the elements |
16 |
* A viewer sorter is used by a {@link StructuredViewer} to reorder the elements |
|
Lines 29-43
Link Here
|
| 29 |
* categorization; and they may override the <code>compare</code> methods |
28 |
* categorization; and they may override the <code>compare</code> methods |
| 30 |
* to provide a totally different way of sorting elements. |
29 |
* to provide a totally different way of sorting elements. |
| 31 |
* </p> |
30 |
* </p> |
| 32 |
* <p> |
31 |
* |
| 33 |
* It is recommended to use <code>ViewerComparator</code> instead. |
|
|
| 34 |
* </p> |
| 35 |
* @see IStructuredContentProvider |
32 |
* @see IStructuredContentProvider |
| 36 |
* @see StructuredViewer |
33 |
* @see StructuredViewer |
|
|
34 |
* |
| 35 |
* @deprecated as of 3.3, use <code>ViewerComparator</code> instead. |
| 37 |
*/ |
36 |
*/ |
| 38 |
public class ViewerSorter extends ViewerComparator { |
37 |
public class ViewerSorter extends ViewerComparator { |
| 39 |
/** |
38 |
/** |
| 40 |
* The collator used to sort strings. |
39 |
* The collator used to sort strings. |
|
|
40 |
* |
| 41 |
* @deprecated as of 3.3 |
| 42 |
* @see {@link ViewerComparator#getComparator()} |
| 41 |
*/ |
43 |
*/ |
| 42 |
protected Collator collator; |
44 |
protected Collator collator; |
| 43 |
|
45 |
|
|
Lines 56-61
Link Here
|
| 56 |
* @param collator the collator to use to sort strings |
58 |
* @param collator the collator to use to sort strings |
| 57 |
*/ |
59 |
*/ |
| 58 |
public ViewerSorter(Collator collator) { |
60 |
public ViewerSorter(Collator collator) { |
|
|
61 |
super(collator); |
| 59 |
this.collator = collator; |
62 |
this.collator = collator; |
| 60 |
} |
63 |
} |
| 61 |
|
64 |
|
|
Lines 63-78
Link Here
|
| 63 |
* Returns the collator used to sort strings. |
66 |
* Returns the collator used to sort strings. |
| 64 |
* |
67 |
* |
| 65 |
* @return the collator used to sort strings |
68 |
* @return the collator used to sort strings |
|
|
69 |
* @deprecated as of 3.3 |
| 70 |
* @see {@link ViewerComparator#getComparator()} |
| 66 |
*/ |
71 |
*/ |
| 67 |
public Collator getCollator() { |
72 |
public Collator getCollator() { |
| 68 |
return collator; |
73 |
return collator; |
| 69 |
} |
74 |
} |
| 70 |
|
75 |
|
| 71 |
|
|
|
| 72 |
/* (non-Javadoc) |
| 73 |
* @see org.eclipse.jface.viewers.ViewerComparator#getComparator() |
| 74 |
*/ |
| 75 |
protected Comparator getComparator() { |
| 76 |
return getCollator(); |
| 77 |
} |
| 78 |
} |
76 |
} |