Project

General

Profile

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

    
12
import org.eclipse.jface.viewers.Viewer;
13
import org.eclipse.jface.viewers.ViewerComparator;
14

    
15
import eu.etaxonomy.cdm.model.term.FeatureTree;
16

    
17
/**
18
 *
19
 * @author pplitzner
20
 * @since May 24, 2019
21
 *
22
 */
23
public class FeatureTreeViewerComparator extends ViewerComparator {
24

    
25
    @Override
26
    public int compare(Viewer viewer, Object e1, Object e2) {
27
        if(e1 instanceof FeatureTree && e2 instanceof FeatureTree) {
28
            return ((FeatureTree)e1).getTitleCache().toLowerCase().compareTo(((FeatureTree) e2).getTitleCache().toLowerCase());
29
        }
30
        return super.compare(viewer, e1, e2);
31
    }
32
}
(2-2/7)