Project

General

Profile

Revision 2aa1d458

ID2aa1d4581fc5edffdb0af37ae7b099dc056d422d
Parent a1fbc94a
Child 656cc90a

Added by Patrick Plitzner over 1 year ago

ref #6850 Fix label for null value

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermLabelProvider.java
88 88
    		if (rep == null){
89 89
    			rep = termBase.getPreferredRepresentation(new ArrayList<Language>());
90 90
    		}
91
    		label = rep != null? rep.getLabel() : termBase.getTitleCache();
91
    		label = rep != null? rep.getLabel() : termBase.generateTitle();
92 92
    		if (element instanceof DefinedTermBase && label!=null) {
93 93
    			DefinedTermBase<?> dtb = (DefinedTermBase<?>) element;
94 94
    			label = CdmUtils.concat(" : ", dtb.getIdInVocabulary(), label);
95 95
    		}
96
    		if(label==null){
97
    		    label = ((TermBase) element).generateTitle();
98
    		}
96 99
    	}
97 100
        // FIXME : must throw an exception here
98 101
    	if(label==null){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractCdmDetailSection.java
23 23
import org.eclipse.ui.forms.widgets.TableWrapLayout;
24 24

  
25 25
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
26
import eu.etaxonomy.cdm.common.CdmUtils;
26 27
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
27 28
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
28 29
import eu.etaxonomy.cdm.model.common.Language;
......
155 156
				if (label == null){
156 157
					label = ((DefinedTermBase<?>)getEntity()).getLabel();
157 158
				}
158

  
159 159
			} else if (getEntity() instanceof TextData){
160 160
				label = ((TextData)getEntity()).getLanguageText(PreferencesUtil.getGlobalLanguage()).getText();
161 161
				if (label == null){
162 162
					label = ((TextData)getEntity()).getLanguageText(Language.DEFAULT()).getText();
163 163
				}
164
			} else{
165
				label =((IdentifiableEntity) getEntity()).getTitleCache();
164
			}
165
			if(CdmUtils.isBlank(label)){
166
				label =((IdentifiableEntity) getEntity()).generateTitle();
166 167
			}
167 168
			title = ": " + label;
168 169
		}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)