Package org.eclipse.ui.navigator
Class CommonViewerSorter
java.lang.Object
org.eclipse.jface.viewers.ViewerComparator
org.eclipse.jface.viewers.ViewerSorter
org.eclipse.jface.viewers.TreePathViewerSorter
org.eclipse.ui.navigator.CommonViewerSorter
@Deprecated(forRemoval=true,
since="2026-03")
public final class CommonViewerSorter
extends TreePathViewerSorter
Deprecated, for removal: This API element is subject to removal in a future version.
Provides an implementation of TreeViewerSorter that uses the given parent to determine the
correct sort order based on the defined
org.eclipse.ui.navigator.navigatorContent/navigatorContent/commonSorter elements
available in the set of visible content extensions.
The CommonViewerSorter must be assigned a INavigatorContentService to drive its sorting
algorithm. Without a valid content service, the sorter will return the default ordering.
A CommonViewerSorter may not be attached to more than one CommonViewer.
- 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(Object element, String property) Deprecated, 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.voidsetContentService(INavigatorContentService aContentService) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.eclipse.jface.viewers.TreePathViewerSorter
category, sortMethods inherited from class org.eclipse.jface.viewers.ViewerSorter
getCollatorMethods inherited from class org.eclipse.jface.viewers.ViewerComparator
compare, getComparator, sort
-
Constructor Details
-
CommonViewerSorter
public CommonViewerSorter()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
category
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ViewerComparatorReturns 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.- Overrides:
categoryin classViewerComparator- Parameters:
element- the element- Returns:
- the category
-
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.Description copied from class:TreePathViewerSorterCompare 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.- Overrides:
comparein classTreePathViewerSorter- 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(Object element, String property) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ViewerComparatorReturns whether this viewer sorter would be affected by a change to the given property of the given element.The default implementation of this method returns
false. Subclasses may reimplement.- Overrides:
isSorterPropertyin classViewerComparator- Parameters:
element- the elementproperty- the property- Returns:
trueif the sorting would be affected, andfalseif it would be unaffected
-
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.Description copied from class:TreePathViewerSorterReturns 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.- Overrides:
isSorterPropertyin classTreePathViewerSorter- Parameters:
parentPath- the parent path of the elementelement- the elementproperty- the property- Returns:
trueif the sorting would be affected, andfalseif it would be unaffected
CommonViewerComparatorinstead.