- changed type of "Materials & Methods" to text instead of DefinedTerm
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 17 Jun 2015 15:35:46 +0000 (17:35 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Mon, 22 Jun 2015 12:58:54 +0000 (14:58 +0200)
 - fixed label

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/dna/DnaSamplePreparationPreservationDetailElement.java

index b30ac1c85a4ff22e213ab5bfa0220d7d31a735f0..3e5a8744a70f9d9e7144f1463658d787be1a9f8d 100644 (file)
@@ -12,15 +12,13 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence.dna;
 
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.Institution;
-import eu.etaxonomy.cdm.model.common.DefinedTerm;
-import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TimePeriod;
 import eu.etaxonomy.cdm.model.molecular.DnaSample;
 import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
-import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
+import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
@@ -36,7 +34,7 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
     private EntitySelectionElement<AgentBase> selectionStaff;
     private TimePeriodElement datePreparationDate;
     private NumberWithLabelElement numberPreservationTemperature;
-    private TermComboElement<DefinedTerm> comboMaterialOrMethods;
+    private TextWithLabelElement txtMaterialOrMethods;
 
     /**
      * @param formFactory
@@ -65,16 +63,16 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
         }
 
         Double temperature = null;
-        DefinedTerm definedMaterialOrMethod = null;
+        String materialOrMethodText = null;
         if(entity.getPreservation()!=null){
             temperature = entity.getPreservation().getTemperature();
-            definedMaterialOrMethod = entity.getPreservation().getDefinedMaterialOrMethod();
+            materialOrMethodText = entity.getPreservation().getMaterialMethodText();
         }
         selectionInstitution = formFactory.createSelectionElement(Institution.class, getConversationHolder(), formElement, "Institution", institution, EntitySelectionElement.ALL, style);
         selectionStaff = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement, "Staff", staff, EntitySelectionElement.ALL, style);
         datePreparationDate = formFactory.createTimePeriodElement(formElement, "Preparation date", preparationDate, style);
         numberPreservationTemperature = formFactory.createNumberTextWithLabelElement(formElement, "Preservation Temp. [C°]", temperature, style);
-        comboMaterialOrMethods = formFactory.createDefinedTermComboElement(TermType.MaterialOrMethod, formElement, "Materials & Methods", definedMaterialOrMethod, style);
+        txtMaterialOrMethods = formFactory.createTextWithLabelElement(formElement, "Materials && Methods", materialOrMethodText, style);
 
     }
 
@@ -105,8 +103,8 @@ public class DnaSamplePreparationPreservationDetailElement extends AbstractCdmDe
         else if(eventSource==numberPreservationTemperature){
             addPreservationMethod().setTemperature(numberPreservationTemperature.getDouble());
         }
-        else if(eventSource==comboMaterialOrMethods){
-            addPreservationMethod().setDefinedMaterialOrMethod(comboMaterialOrMethods.getSelection());
+        else if(eventSource==txtMaterialOrMethods){
+            addPreservationMethod().setMaterialMethodText(txtMaterialOrMethods.getText());
         }
     }