Project

General

Profile

Revision fe4a6e83

IDfe4a6e8325e490d75f11cf3dedb4d7a3939d6d21
Parent 7dc9bbbb
Child 7b1abbc3

Added by Katja Luther about 2 years ago

ref #3836: add the modifier vocabulary to the combobox

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/ModifierElement.java
16 16

  
17 17
import org.eclipse.swt.events.SelectionListener;
18 18

  
19
import eu.etaxonomy.cdm.api.service.IVocabularyService;
20
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
21
import eu.etaxonomy.cdm.model.description.StateData;
22
import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
19 23
import eu.etaxonomy.cdm.model.term.DefinedTerm;
20 24
import eu.etaxonomy.cdm.model.term.TermType;
21 25
import eu.etaxonomy.cdm.model.term.TermVocabulary;
22
import eu.etaxonomy.cdm.model.description.StateData;
23
import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue;
26
import eu.etaxonomy.cdm.model.term.VocabularyEnum;
27
import eu.etaxonomy.taxeditor.store.CdmStore;
24 28
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
25 29
import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
26 30
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
......
69 73
		        StatisticalMeasurementValue statisticalMeasurementValue = (StatisticalMeasurementValue)parentSection.getEntity();
70 74
		        recommendedModifierEnumeration = statisticalMeasurementValue.getQuantitativeData().getFeature().getRecommendedModifierEnumeration();
71 75
		    }
76
		    if (!(parentSection.getParentElement() instanceof StateDataElement || parentSection.getParentElement() instanceof StatisticalMeasurementValueElement)){
77
		        recommendedModifierEnumeration.add(CdmStore.getService(IVocabularyService.class).load(VocabularyEnum.Modifier.getUuid()));
78
		    }
72 79
		    for (TermVocabulary<DefinedTerm> termVocabulary : recommendedModifierEnumeration) {
73 80
		        modifierTerms.addAll(termVocabulary.getTerms());
74 81
		    }
......
106 113
	                DefinedTerm term = combo_modifier.getSelection();
107 114
	                parentEntity.addModifier(term);
108 115
	                entity = term;
116
	            }else {
117
	                ((DescriptionElementBase)parentSection.getEntity()).removeModifier(entity);
118
	                DefinedTerm term = combo_modifier.getSelection();
119
	                ((DescriptionElementBase)parentSection.getEntity()).addModifier(term);
120
                    entity = term;
109 121
	            }
110 122
	        }
111 123
	    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)