Project

General

Profile

« Previous | Next » 

Revision 65434a68

Added by Patrick Plitzner about 6 years ago

Fix saving of ScopeRestriction for PolytomousKey #5280

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ScopeElement.java
14 14

  
15 15
import eu.etaxonomy.cdm.model.common.DefinedTerm;
16 16
import eu.etaxonomy.cdm.model.common.TermType;
17
import eu.etaxonomy.cdm.model.description.TaxonDescription;
17
import eu.etaxonomy.cdm.model.description.PolytomousKey;
18 18
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
19 19
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
20 20
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
21 21
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
22 22
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
23
import eu.etaxonomy.taxeditor.ui.section.key.ScopeRestrictionSection;
23 24

  
24 25
/**
25 26
 * <p>ScopeElement class.</p>
......
68 69
	public void handleEvent(Object eventSource) {
69 70
	    DefinedTerm scopeTerm = combo_scope.getSelection();
70 71
	    if(eventSource==combo_scope && scopeTerm!=null){
71
	        if(getParentElement() instanceof ScopeSection){
72
	            TaxonDescription taxonDescription = ((ScopeSection)getParentElement()).getEntity();
73
	            taxonDescription.removeScope(entity);
74
                taxonDescription.addScope(scopeTerm);
72
	        if(getParentElement() instanceof ScopeRestrictionSection){
73
	            PolytomousKey key = ((ScopeRestrictionSection)getParentElement()).getEntity();
74
	            key.removeScopeRestriction(entity);
75
	            key.addScopeRestriction(scopeTerm);
75 76
                entity = scopeTerm;
76 77
	        }
77 78
	    }

Also available in: Unified diff