Project

General

Profile

Revision f59b9a4e

IDf59b9a4e26e612e9cbe4c5440101f4772b1d324d
Parent 439c838d
Child 468db213

Added by Patrick Plitzner over 1 year ago

fix #6838 show labels according selected language

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/FeatureTreeLabelProvider.java
9 9

  
10 10
package eu.etaxonomy.taxeditor.featuretree;
11 11

  
12
import java.util.ArrayList;
13

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

  
16
import eu.etaxonomy.cdm.model.common.Language;
17
import eu.etaxonomy.cdm.model.common.Representation;
14 18
import eu.etaxonomy.cdm.model.description.Feature;
15 19
import eu.etaxonomy.cdm.model.description.FeatureNode;
16 20
import eu.etaxonomy.cdm.model.description.FeatureTree;
21
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
17 22

  
18 23
/**
19 24
 *
......
30 35
			return ((FeatureTree) element).getTitleCache();
31 36
		}else if(element instanceof FeatureNode){
32 37
		    Feature feature = ((FeatureNode) element).getFeature();
33
			if(feature != null) {
34
			    //FIXME why is there no titleCache already in the DB?
35
                return feature.generateTitle();
38
            Representation rep = feature.getRepresentation(PreferencesUtil.getGlobalLanguage());
39
            if (rep == null){
40
                rep = feature.getPreferredRepresentation(new ArrayList<Language>());
36 41
            }
42
            return rep != null? rep.getLabel() : feature.getTitleCache();
37 43

  
38 44
		}
39 45
		return "No label provided";

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)