Project

General

Profile

Revision eb5c6646

IDeb5c6646d625eb63d4031b226ae2cd99fa7dda48
Parent 8b643532
Child 7cff439d

Added by Katja Luther over 1 year ago

fix #9033: correct handling for notes when switching between status and no staus

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/MultilanguageTextElement.java
172 172
	/** {@inheritDoc} */
173 173
	@Override
174 174
	public void widgetSelected(SelectionEvent e) {
175
		Language selectedLanguage = combo_language.getSelection();
176
		if (selectedLanguage != null) {
177
			LanguageString selectedLanguageString = getMultilanguageText().get(
178
					selectedLanguage);
179

  
180
			element_languageString.setLanguageString(selectedLanguageString);
181
		}
175
	    if (PreferencesUtil.isMultilanguageTextEditingCapability()) {
176
    		Language selectedLanguage = combo_language.getSelection();
177
    		if (selectedLanguage != null) {
178
    			LanguageString selectedLanguageString = getMultilanguageText().get(
179
    					selectedLanguage);
180

  
181
    			element_languageString.setLanguageString(selectedLanguageString);
182
    		}
183
	    }
182 184
	}
183 185

  
184 186
	/*
......
217 219

  
218 220
	@Override
219 221
	public void refresh(){
220
	    Language lang = combo_language.getSelection();
221
	    if (multilanguageText.get(lang)!= null){
222
	        this.element_languageString.setText(multilanguageText.get(combo_language.getSelection()).getText());
222
	    if (PreferencesUtil.isMultilanguageTextEditingCapability()) {
223
	        Language lang = combo_language.getSelection();
224
	        if (multilanguageText.get(lang)!= null){
225
	            this.element_languageString.setText(multilanguageText.get(combo_language.getSelection()).getText());
226
	        }else{
227
	            this.element_languageString.setText(null);
228
	        }
223 229
	    }else{
224
	        this.element_languageString.setText(null);
230
	        if (multilanguageText != null && multilanguageText.get(CdmStore.getDefaultLanguage()) != null){
231
	            this.element_languageString.setText(multilanguageText.get(CdmStore.getDefaultLanguage()).getText());
232
	        }
225 233
	    }
234

  
226 235
	}
227 236

  
228 237
	/**
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/classification/TaxonNodeDetailElement.java
369 369

  
370 370
		if (eventSource == combo_status) {
371 371
            status = (TaxonNodeStatus) combo_status.getSelection();
372
            if (status == null){
373
                if (multiLanguageTextStatusNotes.getMultilanguageText() != null && !multiLanguageTextStatusNotes.getMultilanguageText().isEmpty()){
374
                    multilanguageTextCache = new HashMap<>();
375
                    for (LanguageString langString: multiLanguageTextStatusNotes.getMultilanguageText().values()){
376
                        multilanguageTextCache.put(langString.getLanguage(), langString);
377
                    }
378
//                    multilanguageTextCache = multiLanguageTextStatusNotes.getMultilanguageText();
379
                }
380
                multiLanguageTextStatusNotes.setMultilanguageText(new HashMap<>());
381
//                multiLanguageTextStatusNotes.refresh();
382

  
383
            }else if (multilanguageTextCache != null ){
384

  
385
                multiLanguageTextStatusNotes.setMultilanguageText(multilanguageTextCache);
386
                multilanguageTextCache = null;
387
            }
372 388
            if (!isCreateNew()){
373 389
                getEntity().setStatus(status);
374 390
                if (status == null){
......
384 400
                }
385 401
            }
386 402

  
387
            if (status == null){
388
                if (multiLanguageTextStatusNotes.getMultilanguageText() != null && !multiLanguageTextStatusNotes.getMultilanguageText().isEmpty()){
389
                    multilanguageTextCache = multiLanguageTextStatusNotes.getMultilanguageText();
390
                }
391
                multiLanguageTextStatusNotes.setMultilanguageText(new HashMap<>());
392
                multiLanguageTextStatusNotes.refresh();
393 403

  
394
            }else if (multilanguageTextCache != null ){
395
                multiLanguageTextStatusNotes.setMultilanguageText(multilanguageTextCache);
396
                multilanguageTextCache = null;
397
            }
398 404
            multiLanguageTextStatusNotes.setEnabled(status != null);
399 405

  
400 406
            complete = true;

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)