下面列出了怎么用org.eclipse.ui.views.navigator.ResourceSorter的API类实例代码及写法,或者点击链接到github查看源代码。
protected TreeViewer createResourceSelectionTree(Composite composite, int types, int span) {
TreeViewer tree = new TreeViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
tree.setUseHashlookup(true);
tree.setContentProvider(getResourceProvider(types));
tree.setLabelProvider(
new DecoratingLabelProvider(
new WorkbenchLabelProvider(),
SVNUIPlugin.getPlugin().getWorkbench().getDecoratorManager().getLabelDecorator()));
tree.setSorter(new ResourceSorter(ResourceSorter.NAME));
GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL);
data.heightHint = LIST_HEIGHT_HINT;
data.horizontalSpan = span;
tree.getControl().setLayoutData(data);
return tree;
}
/**
* Construct a sorter that uses the name of the resource as its sorting
* criteria.
*
*/
public ResourceExtensionSorter() {
super(ResourceSorter.NAME);
}
/**
* Construct a sorter that uses the name of the resource as its sorting
* criteria.
*
*/
public ResourceExtensionSorter() {
super(ResourceSorter.NAME);
}