Project

General

Profile

Download (1.09 KB) 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

    
10
package eu.etaxonomy.taxeditor.featuretree;
11

    
12
import org.eclipse.jface.viewers.LabelProvider;
13

    
14
import eu.etaxonomy.cdm.model.description.Feature;
15
import eu.etaxonomy.cdm.model.description.FeatureNode;
16
import eu.etaxonomy.cdm.model.description.FeatureTree;
17

    
18
/**
19
 *
20
 * @author n.hoffmann
21
 * @created Aug 5, 2010
22
 * @version 1.0
23
 */
24
public class FeatureTreeLabelProvider extends LabelProvider {
25

    
26
	/** {@inheritDoc} */
27
	@Override
28
	public String getText(Object element) {
29
		if(element instanceof FeatureTree){
30
			return ((FeatureTree) element).getTitleCache();
31
		}else if(element instanceof FeatureNode){
32
		    Feature feature = ((FeatureNode) element).getFeature();
33
			if(feature != null) {
34
			    //FIXME why is there no titleCache already in the DB?
35
                return feature.generateTitle();
36
            }
37

    
38
		}
39
		return "No label provided";
40
	}
41

    
42
}
(7-7/7)