Project

General

Profile

« Previous | Next » 

Revision 5ab46e89

Added by Katja Luther over 5 years ago

ref #7854: show label corresponding to preferences

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditor.java
78 78
import eu.etaxonomy.cdm.model.common.Language;
79 79
import eu.etaxonomy.cdm.model.common.OrderedTermBase;
80 80
import eu.etaxonomy.cdm.model.common.OrderedTermComparator;
81
import eu.etaxonomy.cdm.model.common.Representation;
81 82
import eu.etaxonomy.cdm.model.common.TermIdInVocabularyComparator;
82 83
import eu.etaxonomy.cdm.model.common.TermLanguageComparator;
83 84
import eu.etaxonomy.cdm.model.common.TermVocabulary;
......
533 534
        loadNamedAreas();
534 535
        for (DefinedTermBase area: areas) {
535 536
            this.areaToColumnIndexMap.put(index++, (NamedArea)area);
536

  
537
            String areaLabel;
537 538
            //TODO: adapt to preference
538
            String areaLabel = area.getLabel();
539
            Representation rep = area.getPreferredRepresentation(CdmStore.getDefaultLanguage());
540
            String label = rep.getLabel();
541
            if (label == null){
542
                label = area.getTitleCache();
543
            }
544
            if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
545
                if (area.getIdInVocabulary() != null){
546
                    areaLabel = area.getIdInVocabulary();
547
                } else{
548
                    areaLabel = label;
549
                }
550
            }else if (PreferencesUtil.isShowSymbol1InChecklistEditor()){
551
                if (area.getSymbol() != null){
552
                    areaLabel = area.getSymbol();
553
                } else{
554
                    areaLabel = label;
555
                }
556
            }else if (PreferencesUtil.isShowSymbol2InChecklistEditor()){
557
                if (area.getSymbol2() != null){
558
                    areaLabel = area.getSymbol2();
559
                } else{
560
                    areaLabel = label;
561
                }
562
            }else{
563
                areaLabel = label;
564
            }
565

  
566

  
567
            //String areaLabel = area.getLabel();
539 568
            String property = areaLabel;
540 569
            propertyToLabelMap.put(property, areaLabel);
541 570
        }

Also available in: Unified diff