- added functionality to determination section to add determinations to FieldUnits...
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 16 Jun 2014 09:28:23 +0000 (09:28 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 16 Jun 2014 09:28:23 +0000 (09:28 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/AbstractDeterminationEventDetailSection.java

index 0f9b58bb158d5e765b92333acd94b73dcbdd2b42..84613ac8a18bc484b93c80111291c86ffdeb13f8 100644 (file)
@@ -13,6 +13,8 @@ package eu.etaxonomy.taxeditor.ui.section.occurrence;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
@@ -47,7 +49,12 @@ public abstract class AbstractDeterminationEventDetailSection extends
        @Override
        public DeterminationEvent createNewElement() {
                DeterminationEvent instance = DeterminationEvent.NewInstance();
-               instance.setIdentifiedUnit(getEntity().innerDerivedUnit());
+        if(PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DETERMINATION_ONLY_FOR_FIELD_UNITS)){
+            instance.setIdentifiedUnit(getEntity().innerFieldUnit());
+        }
+        else{
+            instance.setIdentifiedUnit(getEntity().innerDerivedUnit());
+        }
                return instance;
        }