- reverted accidentally commited changes of campanula branch
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 23 Jul 2013 11:18:49 +0000 (11:18 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 23 Jul 2013 11:18:49 +0000 (11:18 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java

index 5a1fc39fa2b3c54c207d65b049a5c5e1b5bcd6f3..7391066beee23e32ba3cb4ae1cf8bf7a198e78b8 100644 (file)
 package eu.etaxonomy.taxeditor.ui.section.occurrence;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.cdm.model.description.Sex;
+import eu.etaxonomy.cdm.model.description.Stage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+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;
@@ -37,9 +40,9 @@ public class FieldObservationDetailElement extends AbstractCdmDetailElement<Deri
 
        private NumberWithLabelElement number_individualCount;
 
-//     private TermComboElement<Sex> combo_sex;
-//
-//     private TermComboElement<Stage> combo_lifeStage;
+       private TermComboElement<Sex> combo_sex;
+
+       private TermComboElement<Stage> combo_lifeStage;
 
        /**
         * <p>Constructor for FieldObservationDetailElement.</p>
@@ -63,8 +66,8 @@ public class FieldObservationDetailElement extends AbstractCdmDetailElement<Deri
                text_fieldNotes = formFactory.createTextWithLabelElement(formElement, "Field Notes", entity.getFieldNotes(), style);
 
                number_individualCount = formFactory.createIntegerTextWithLabelElement(formElement, "Individual Count", entity.getIndividualCount(), style);
-//             combo_lifeStage = formFactory.createTermComboElement(Stage.class, formElement, "Life Stage", entity.getLifeStage(), style);
-//             combo_sex = formFactory.createTermComboElement(Sex.class, formElement, "Sex", entity.getSex(), style);
+               combo_lifeStage = formFactory.createTermComboElement(Stage.class, formElement, "Life Stage", entity.getLifeStage(), style);
+               combo_sex = formFactory.createTermComboElement(Sex.class, formElement, "Sex", entity.getSex(), style);
        }
 
        /** {@inheritDoc} */
@@ -85,11 +88,11 @@ public class FieldObservationDetailElement extends AbstractCdmDetailElement<Deri
                else if(eventSource == number_individualCount){
                        getEntity().setIndividualCount(number_individualCount.getInteger());
                }
-//             else if(eventSource == combo_lifeStage){
-//                     getEntity().setLifeStage(combo_lifeStage.getSelection());
-//             }
-//             else if(eventSource == combo_sex){
-//                     getEntity().setSex(combo_sex.getSelection());
-//             }
+               else if(eventSource == combo_lifeStage){
+                       getEntity().setLifeStage(combo_lifeStage.getSelection());
+               }
+               else if(eventSource == combo_sex){
+                       getEntity().setSex(combo_sex.getSelection());
+               }
        }
 }
index 8ad6526234531b9d62eea3b6f0c9c761d7ee8a9b..c62ef9331024697be1a2fcb4a8a563891f8cd2e6 100644 (file)
@@ -14,6 +14,7 @@ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.common.LanguageString;
 import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.occurrence.Collection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
@@ -42,8 +43,8 @@ public class GeneralDetailElement extends
        private TimePeriodElement element_date;
        private EntitySelectionElement<AgentBase> selection_collector;
        private TextWithLabelElement text_collectingNumber;
-//     private EntitySelectionElement<Collection> selection_collection;
-//     private TextWithLabelElement text_accessionNumber;
+       private EntitySelectionElement<Collection> selection_collection;
+       private TextWithLabelElement text_accessionNumber;
 
        /**
         * @param formFactory
@@ -88,14 +89,14 @@ public class GeneralDetailElement extends
                                                style);
                text_collectingNumber = formFactory.createTextWithLabelElement(formElement,
                                "Collecting number", entity.getFieldNumber(), style);
-//             selection_collection = formFactory
-//                             .createSelectionElement(Collection.class,
-//                                             getConversationHolder(), formElement, "Collection",
-//                                             entity.getCollection(),
-//                                             EntitySelectionElement.ALL, style);
-//             text_accessionNumber = formFactory.createTextWithLabelElement(
-//                             formElement, "Accession Number", entity.getAccessionNumber(),
-//                             style);
+               selection_collection = formFactory
+                               .createSelectionElement(Collection.class,
+                                               getConversationHolder(), formElement, "Collection",
+                                               entity.getCollection(),
+                                               EntitySelectionElement.ALL, style);
+               text_accessionNumber = formFactory.createTextWithLabelElement(
+                               formElement, "Accession Number", entity.getAccessionNumber(),
+                               style);
 
        }
 
@@ -127,11 +128,11 @@ public class GeneralDetailElement extends
                } else if (eventSource == text_collectingNumber) {
                        getEntity().setFieldNumber(text_collectingNumber.getText());
                }
-//               else if (eventSource == selection_collection) {
-//                     getEntity().setCollection(selection_collection.getSelection());
-//             } else if (eventSource == text_accessionNumber) {
-//                     getEntity().setAccessionNumber(text_accessionNumber.getText());
-//             }
+                 else if (eventSource == selection_collection) {
+                       getEntity().setCollection(selection_collection.getSelection());
+               } else if (eventSource == text_accessionNumber) {
+                       getEntity().setAccessionNumber(text_accessionNumber.getText());
+               }
 
                if (eventSource != toggleableText_titleCache) {
                        toggleableText_titleCache.setText(getEntity().getTitleCache());