Project

General

Profile

Download (985 Bytes) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.editor.view.descriptive;
10

    
11
import org.eclipse.jface.viewers.Viewer;
12
import org.eclipse.jface.viewers.ViewerSorter;
13

    
14
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
15
import eu.etaxonomy.taxeditor.model.DescriptionHelper;
16

    
17
/**
18
 * @author n.hoffmann
19
 * @created Dec 2, 2010
20
 */
21
public class DescriptiveViewerSorter extends ViewerSorter {
22

    
23
	@Override
24
	public int compare(Viewer viewer, Object e1, Object e2) {
25
		if((e1 instanceof DescriptionElementBase) && (e2 instanceof DescriptionElementBase)){
26
			return DescriptionHelper.getLabel((DescriptionElementBase)e1).compareTo(DescriptionHelper.getLabel((DescriptionElementBase)e2));
27
		}
28
		return super.compare(viewer, e1, e2);
29
	}
30
}
(6-6/7)