commit d21a66e34fdc618c953aa780201e5887b48c3de9
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Mon Nov 2 17:04:14 2015 +0100

    Inherit from abstract type designation element
    
     - label fix

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java
index 16249fe38..9800e7df6 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/association/DerivedUnitTypeDesignationElement.java
@@ -15,12 +15,16 @@ import java.util.Set;
 
 import org.eclipse.swt.events.SelectionListener;
 
+import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
+import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
 import eu.etaxonomy.taxeditor.ui.element.AbstractFormSection;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
-import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionElement;
+import eu.etaxonomy.taxeditor.ui.section.name.AbstractTypeDesignationElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
@@ -28,8 +32,10 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @created May 17, 2010
  * @version 1.0
  */
-public class DerivedUnitTypeDesignationElement extends
-		AbstractEntityCollectionElement<SpecimenTypeDesignation> {
+public class DerivedUnitTypeDesignationElement extends AbstractTypeDesignationElement<SpecimenTypeDesignation> {
+
+    private TermComboElement<SpecimenTypeDesignationStatus> combo_typeStatus;
+    private EntitySelectionElement<DerivedUnit> selection_typeSpecimen;
 
     private List<EntitySelectionElement<TaxonNameBase>> selectionTaxonNames;
     private ICdmFormElement parentFormElement;
@@ -38,7 +44,7 @@ public class DerivedUnitTypeDesignationElement extends
     public DerivedUnitTypeDesignationElement(CdmFormFactory formFactory,
             AbstractFormSection section, SpecimenTypeDesignation entity,
             SelectionListener removeListener, int style) {
-        super(formFactory, section, entity, removeListener, null, style);
+        super(formFactory, section, entity, removeListener, style);
     }
 
     @Override
@@ -47,17 +53,27 @@ public class DerivedUnitTypeDesignationElement extends
         Set<TaxonNameBase> typifiedNames = entity.getTypifiedNames();
         if(typifiedNames.isEmpty()){
             formFactory.createSelectionElement(
-                    TaxonNameBase.class, getConversationHolder(), parentFormElement, "Taxon Name", null,
+                    TaxonNameBase.class, getConversationHolder(), parentFormElement, "Scientific Name", null,
                     EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE, style);
         }
         else{
             for (TaxonNameBase taxonNameBase : typifiedNames) {
                 EntitySelectionElement<TaxonNameBase> selectionElement = formFactory.createSelectionElement(
-                        TaxonNameBase.class, getConversationHolder(), parentFormElement, "Taxon Name", null,
+                        TaxonNameBase.class, getConversationHolder(), parentFormElement, "Scientific Name", null,
                         EntitySelectionElement.EDITABLE | EntitySelectionElement.SELECTABLE, style);
                 selectionElement.setEntity(taxonNameBase);
             }
         }
+
+        checkbox_notDesignated = formFactory.createCheckbox(parentFormElement, "Not Designated", false, style);
+
+        selection_typeSpecimen = formFactory
+                .createSelectionElement(DerivedUnit.class,
+                        getConversationHolder(), parentFormElement, "Specimen", null,
+                        EntitySelectionElement.ALL, style);
+        combo_typeStatus = formFactory.createDefinedTermComboElement(TermType.SpecimenTypeDesignationStatus,
+                        parentFormElement, "Designation Status", null, style);
+
     }
 
     /** {@inheritDoc} */
@@ -65,14 +81,22 @@ public class DerivedUnitTypeDesignationElement extends
     public void createControls(ICdmFormElement element, int style) {
         this.parentFormElement = element;
         this.style = style;
+        super.createControls(element, style);
     }
 
     /** {@inheritDoc} */
     @Override
     public void handleEvent(Object eventSource) {
-        if (eventSource instanceof EntitySelectionElement) {
+        if (selectionTaxonNames.contains(eventSource)) {
             ((EntitySelectionElement<TaxonNameBase>) eventSource).getSelection().addTypeDesignation(getEntity(), false);
         }
+        else if (eventSource == combo_typeStatus) {
+            getEntity().setTypeStatus(combo_typeStatus.getSelection());
+        } else if (eventSource == selection_typeSpecimen) {
+            getEntity().setTypeSpecimen(selection_typeSpecimen.getSelection());
+        }  else if (eventSource == checkbox_notDesignated) {
+            getEntity().setNotDesignated(checkbox_notDesignated.getSelection());
+        }
     }
 
 }
