Package org.eclipse.jface.viewers
Class TreePathViewerSorter
java.lang.Object
org.eclipse.jface.viewers.ViewerComparator
org.eclipse.jface.viewers.ViewerSorter
org.eclipse.jface.viewers.TreePathViewerSorter
- Direct Known Subclasses:
CommonViewerSorter
@Deprecated(forRemoval=true,
since="2026-03")
public class TreePathViewerSorter
extends ViewerSorter
Deprecated, for removal: This API element is subject to removal in a future version.
A viewer sorter that is provided extra context in the form of the path of the
parent element of the elements being sorted.
- Since:
- 3.2
-
Field Summary
Fields inherited from class org.eclipse.jface.viewers.ViewerSorter
collator -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.booleanisSorterProperty(TreePath parentPath, Object element, String property) Deprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.eclipse.jface.viewers.ViewerSorter
getCollatorMethods inherited from class org.eclipse.jface.viewers.ViewerComparator
category, compare, getComparator, isSorterProperty, sort
-
Constructor Details
-
TreePathViewerSorter
public TreePathViewerSorter()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
category
@Deprecated(forRemoval=true, since="2026-03") public int category(TreePath parentPath, Object element) Deprecated, for removal: This API element is subject to removal in a future version.Provide a category for the given element that will have the given parent path when it is added to the viewer. The provided path is relative to the viewer input. The parent path will benullwhen the elements are root elements.By default, the this method calls
ViewerSorter#category(Object). Subclasses may override.- Parameters:
parentPath- the parent path for the elementelement- the element- Returns:
- the category of the element
-
compare
@Deprecated(forRemoval=true, since="2026-03") public int compare(Viewer viewer, TreePath parentPath, Object e1, Object e2) Deprecated, for removal: This API element is subject to removal in a future version.Compare the given elements that will have the given parent path when they are added to the viewer. The provided path is relative to the viewer input. The parent path will benullwhen the elements are root elements.By default, the this method calls
ViewerSorter#sort(Viewer, Object[]). Subclasses may override.- Parameters:
viewer- the viewerparentPath- the parent path for the two elementse1- the first elemente2- the second element- Returns:
- a negative number if the first element is less than the
second element; the value
0if the first element is equal to the second element; and a positive
-
isSorterProperty
@Deprecated(forRemoval=true, since="2026-03") public boolean isSorterProperty(TreePath parentPath, Object element, String property) Deprecated, for removal: This API element is subject to removal in a future version.Returns whether this viewer sorter would be affected by a change to the given property of the given element. The provided path is relative to the viewer input. The parent path will benullwhen the elements are root elements.The default implementation of this method calls
ViewerSorter#isSorterProperty(Object, String). Subclasses may reimplement.- Parameters:
parentPath- the parent path of the elementelement- the elementproperty- the property- Returns:
trueif the sorting would be affected, andfalseif it would be unaffected
-
sort
@Deprecated(forRemoval=true, since="2026-03") public void sort(Viewer viewer, TreePath parentPath, Object[] elements) Deprecated, for removal: This API element is subject to removal in a future version.Sorts the given elements in-place, modifying the given array. The provided path is relative to the viewer input. The parent path will benullwhen the elements are root elements.The default implementation of this method uses the java.util.Arrays#sort algorithm on the given array, calling
compare(Viewer, TreePath, Object, Object)to compare elements.Subclasses may reimplement this method to provide a more optimized implementation.
- Parameters:
viewer- the viewerparentPath- the parent path of the given elementselements- the elements to sort
-
TreePathViewerComparatorinstead.