KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > model > WorkbenchViewerSorter


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.model;
12
13 import java.text.Collator JavaDoc; // can't use ICU, public API
14

15 import org.eclipse.jface.viewers.IBasicPropertyConstants;
16 import org.eclipse.jface.viewers.ViewerSorter;
17
18 /**
19  * A viewer sorter that sorts elements with registered workbench adapters by their text property.
20  * Note that capitalization differences are not considered by this
21  * sorter, so a > B > c
22  *
23  * @see IWorkbenchAdapter
24  * @deprecated as of 3.3, use {@link WorkbenchViewerComparator} instead
25  */

26 public class WorkbenchViewerSorter extends ViewerSorter {
27
28     /**
29      * Creates a workbench viewer sorter using the default collator.
30      */

31     public WorkbenchViewerSorter() {
32         super();
33     }
34
35     /**
36      * Creates a workbench viewer sorter using the given collator.
37      *
38      * @param collator the collator to use to sort strings
39      */

40     public WorkbenchViewerSorter(Collator JavaDoc collator) {
41         super(collator);
42     }
43
44     /* (non-Javadoc)
45      * Method declared on ViewerSorter.
46      */

47     public boolean isSorterProperty(Object JavaDoc element, String JavaDoc propertyId) {
48         return propertyId.equals(IBasicPropertyConstants.P_TEXT);
49     }
50 }
51
Popular Tags