From: Katja Luther Date: Wed, 5 Oct 2016 12:52:40 +0000 (+0200) Subject: fix #6047: add the possibility to the termComboElement that the idInVoc is used as... X-Git-Tag: 4.4.0^2~119 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/79d06d0fbf697cbd509e959f46ee6c1c82db545b?ds=sidebyside fix #6047: add the possibility to the termComboElement that the idInVoc is used as label --- diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java index 65ba7e019..c2f5a806f 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java @@ -48,36 +48,43 @@ public class TermComboElement private List customPreferredTerms; + private boolean useAbbrevLabel = false; private boolean addEmptyElement; public TermComboElement(CdmFormFactory formFactory, ICdmFormElement parentElement, TermType termType, String labelString, T selection, boolean addEmptyElement, - int style) { - this(formFactory, parentElement, null, termType, null, labelString, selection, addEmptyElement, style); + int style, boolean useAbbrevLabel) { + this(formFactory, parentElement, null, termType, null, labelString, selection, addEmptyElement, style, useAbbrevLabel); } public TermComboElement(CdmFormFactory formFactory, ICdmFormElement parentElement, TermVocabulary termVocabulary, String labelString, T selection, boolean addEmptyElement, int style) { - this(formFactory, parentElement, null, null, termVocabulary, labelString, selection, addEmptyElement, style); + this(formFactory, parentElement, null, null, termVocabulary, labelString, selection, addEmptyElement, style, false); } public TermComboElement(CdmFormFactory formFactory, ICdmFormElement parentElement, Class termClass, String labelString, T selection, boolean addEmptyElement, int style) { - this(formFactory, parentElement, termClass, null, null, labelString, selection, addEmptyElement, style); + this(formFactory, parentElement, termClass, null, null, labelString, selection, addEmptyElement, style, false); + } + public TermComboElement(CdmFormFactory formFactory, + ICdmFormElement parentElement, Class termClass, String labelString, T selection, boolean addEmptyElement, + int style, boolean useAbbrevLabel) { + this(formFactory, parentElement, termClass, null, null, labelString, selection, addEmptyElement, style, useAbbrevLabel); + } private TermComboElement(CdmFormFactory formFactory, ICdmFormElement parentElement, Class termClass, TermType termType, TermVocabulary termVocabulary, String labelString, T selection, boolean addEmptyElement, - int style) { + int style, boolean useAbbrevLabel) { super(formFactory, parentElement); this.termType = termType; this.termVocabulary = termVocabulary; this.termClass = termClass; this.addEmptyElement = addEmptyElement; - + this.useAbbrevLabel = useAbbrevLabel; if (labelString != null) { label.setText(labelString); } @@ -225,7 +232,12 @@ public class TermComboElement if (term == null){ return ""; }else{ - String termLabel = term.getLabel(CdmStore.getDefaultLanguage()); + String termLabel = null; + if (useAbbrevLabel){ + termLabel = term.getIdInVocabulary(); + }else{ + termLabel = term.getLabel(CdmStore.getDefaultLanguage()); + } if (termLabel == null){ termLabel = term.getLabel(); }