Project

General

Profile

« Previous | Next » 

Revision 79d06d0f

Added by Katja Luther over 7 years ago

fix #6047: add the possibility to the termComboElement that the idInVoc is used as label

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/combo/TermComboElement.java
48 48

  
49 49
	private List<T> customPreferredTerms;
50 50

  
51
	private boolean useAbbrevLabel = false;
51 52
	private boolean addEmptyElement;
52 53

  
53 54
	public TermComboElement(CdmFormFactory formFactory,
54 55
			ICdmFormElement parentElement, TermType termType, String labelString, T selection, boolean addEmptyElement,
55
			int style) {
56
		this(formFactory, parentElement, null, termType, null, labelString, selection, addEmptyElement, style);
56
			int style, boolean useAbbrevLabel) {
57
		this(formFactory, parentElement, null, termType, null, labelString, selection, addEmptyElement, style, useAbbrevLabel);
57 58
	}
58 59

  
59 60
	public TermComboElement(CdmFormFactory formFactory,
60 61
	        ICdmFormElement parentElement, TermVocabulary<?> termVocabulary, String labelString, T selection, boolean addEmptyElement,
61 62
	        int style) {
62
	    this(formFactory, parentElement, null, null, termVocabulary, labelString, selection, addEmptyElement, style);
63
	    this(formFactory, parentElement, null, null, termVocabulary, labelString, selection, addEmptyElement, style, false);
63 64
	}
64 65

  
65 66
    public TermComboElement(CdmFormFactory formFactory,
66 67
            ICdmFormElement parentElement, Class<T> termClass, String labelString, T selection, boolean addEmptyElement,
67 68
            int style) {
68
        this(formFactory, parentElement, termClass, null, null, labelString, selection, addEmptyElement, style);
69
        this(formFactory, parentElement, termClass, null, null, labelString, selection, addEmptyElement, style, false);
70
    }
71
    public TermComboElement(CdmFormFactory formFactory,
72
            ICdmFormElement parentElement, Class<T> termClass, String labelString, T selection, boolean addEmptyElement,
73
            int style, boolean useAbbrevLabel) {
74
        this(formFactory, parentElement, termClass, null, null, labelString, selection, addEmptyElement, style, useAbbrevLabel);
75
       
69 76
    }
70 77

  
71 78
	private TermComboElement(CdmFormFactory formFactory,
72 79
	        ICdmFormElement parentElement, Class<T> termClass, TermType termType, TermVocabulary<?> termVocabulary, String labelString, T selection, boolean addEmptyElement,
73
	        int style) {
80
	        int style, boolean useAbbrevLabel) {
74 81
        super(formFactory, parentElement);
75 82

  
76 83
        this.termType = termType;
77 84
        this.termVocabulary = termVocabulary;
78 85
        this.termClass = termClass;
79 86
        this.addEmptyElement = addEmptyElement;
80

  
87
        this.useAbbrevLabel = useAbbrevLabel;
81 88
        if (labelString != null) {
82 89
            label.setText(labelString);
83 90
        }
......
225 232
		if (term == null){
226 233
			return "";
227 234
		}else{
228
			String termLabel = term.getLabel(CdmStore.getDefaultLanguage());
235
			String termLabel = null;
236
			if (useAbbrevLabel){
237
				termLabel = term.getIdInVocabulary();
238
			}else{
239
				termLabel = term.getLabel(CdmStore.getDefaultLanguage());
240
			}
229 241
			if (termLabel == null){
230 242
			    termLabel = term.getLabel();
231 243
			}

Also available in: Unified diff