01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.model;
11:
12: import java.text.Collator; // can't use ICU, public API
13:
14: import org.eclipse.jface.viewers.IBasicPropertyConstants;
15: import org.eclipse.jface.viewers.ViewerSorter;
16:
17: /**
18: * A viewer sorter that sorts elements with registered workbench adapters by their text property.
19: * Note that capitalization differences are not considered by this
20: * sorter, so a > B > c
21: *
22: * @see IWorkbenchAdapter
23: * @deprecated as of 3.3, use {@link WorkbenchViewerComparator} instead
24: */
25: public class WorkbenchViewerSorter extends ViewerSorter {
26:
27: /**
28: * Creates a workbench viewer sorter using the default collator.
29: */
30: public WorkbenchViewerSorter() {
31: super ();
32: }
33:
34: /**
35: * Creates a workbench viewer sorter using the given collator.
36: *
37: * @param collator the collator to use to sort strings
38: */
39: public WorkbenchViewerSorter(Collator collator) {
40: super (collator);
41: }
42:
43: /* (non-Javadoc)
44: * Method declared on ViewerSorter.
45: */
46: public boolean isSorterProperty(Object element, String propertyId) {
47: return propertyId.equals(IBasicPropertyConstants.P_TEXT);
48: }
49: }
|