|
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
org.eclipse.jface.viewers.TreePathViewerSorter
org.eclipse.ui.navigator.CommonViewerSorter
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 vaild content service, the sorter will return the default ordering.
A CommonViewerSorter may not be attached to more than one CommonViewer.
Clients may not extend this class.
Field Summary |
---|
Fields inherited from class org.eclipse.jface.viewers.ViewerSorter |
---|
collator |
Constructor Summary | |
---|---|
CommonViewerSorter()
|
Method Summary | |
---|---|
int |
category(Object element)
Returns the category of the given element. |
int |
compare(Viewer viewer,
TreePath parentPath,
Object e1,
Object e2)
Compare the givcen elements that will have the given parent path when they are added to the viewer. |
protected void |
setContentService(org.eclipse.ui.internal.navigator.NavigatorContentService aContentService)
Create a sorter service attached to the given content service. |
Methods inherited from class org.eclipse.jface.viewers.TreePathViewerSorter |
---|
category, isSorterProperty, sort |
Methods inherited from class org.eclipse.jface.viewers.ViewerSorter |
---|
getCollator, getComparator |
Methods inherited from class org.eclipse.jface.viewers.ViewerComparator |
---|
compare, isSorterProperty, sort |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommonViewerSorter()
Method Detail |
protected void setContentService(org.eclipse.ui.internal.navigator.NavigatorContentService aContentService)
aContentService
- The content service used by the viewer that will use this sorter service.public int category(Object element)
ViewerComparator
The default implementation of this framework method returns
0
. Subclasses may reimplement this method to provide
non-trivial categorization.
category
in class ViewerComparator
element
- the element
public int compare(Viewer viewer, TreePath parentPath, Object e1, Object e2)
TreePathViewerSorter
null
when the elements are root elements.
By default, the this method calls
ViewerComparator.sort(Viewer, Object[])
. Subclasses may override.
compare
in class TreePathViewerSorter
viewer
- the viewerparentPath
- the parent path for the two elementse1
- the first elemente2
- the second element
0
if the first element is
equal to the second element; and a positive
|
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.