blob: f660f3cf98eefe877742b4d494fe81689bc502c0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
/*******************************************************************************
* Copyright (c) 2000, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.search.internal.ui;
import java.text.Collator;
import java.util.Comparator;
import org.eclipse.ui.IWorkingSet;
class WorkingSetComparator implements Comparator {
private Collator fCollator= Collator.getInstance();
/*
* @see Comparator#compare(Object, Object)
*/
public int compare(Object o1, Object o2) {
String name1= null;
String name2= null;
if (o1 instanceof IWorkingSet)
name1= ((IWorkingSet)o1).getName();
if (o2 instanceof IWorkingSet)
name2= ((IWorkingSet)o2).getName();
return fCollator.compare(name1, name2);
}
}
|