ref #6190 removing svn property place holder in first line of code - java files
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / name / SpecimenTypeDesignationElement.java
index ed46ae652592ed2d9eab140281632ff891a8780a..cb0652e18cbab9c9017efe508af184ffbb84981e 100644 (file)
@@ -1,9 +1,8 @@
-// $Id$
 /**
  * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy 
+ * European Distributed Institute of Taxonomy
  * http://www.e-taxonomy.eu
- * 
+ *
  * The contents of this file are subject to the Mozilla Public License Version 1.1
  * See LICENSE.TXT at the top of this package for the full license terms.
  */
@@ -13,22 +12,19 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 import org.eclipse.swt.events.SelectionListener;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+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.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
 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.element.TextWithLabelElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
- * <p>
- * SpecimenTypeDesignationElement class.
- * </p>
- * 
  * @author n.hoffmann
  * @created May 17, 2010
  * @version 1.0
@@ -40,25 +36,6 @@ public class SpecimenTypeDesignationElement extends
        private EntitySelectionElement<DerivedUnit> selection_typeSpecimen;
        private TextWithLabelElement text_specimenTypeText;
 
-       /**
-        * <p>
-        * Constructor for SpecimenTypeDesignationElement.
-        * </p>
-        * 
-        * @param formFactory
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
-        *            object.
-        * @param section
-        *            a {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
-        *            object.
-        * @param entity
-        *            a {@link eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation}
-        *            object.
-        * @param removeListener
-        *            a {@link org.eclipse.swt.events.SelectionListener} object.
-        * @param style
-        *            a int.
-        */
        public SpecimenTypeDesignationElement(CdmFormFactory formFactory,
                        AbstractFormSection section, SpecimenTypeDesignation entity,
                        SelectionListener removeListener, int style) {
@@ -72,8 +49,7 @@ public class SpecimenTypeDesignationElement extends
                                .createSelectionElement(DerivedUnit.class,
                                                getConversationHolder(), formElement, "Specimen", null,
                                                EntitySelectionElement.ALL, style);
-               combo_typeStatus = formFactory
-                               .createTermComboElement(SpecimenTypeDesignationStatus.class,
+               combo_typeStatus = formFactory.createDefinedTermComboElement(TermType.SpecimenTypeDesignationStatus,
                                                formElement, "Designation Status", null, style);
 
                super.createControls(formElement, style);
@@ -85,8 +61,8 @@ public class SpecimenTypeDesignationElement extends
                super.setEntity(entity);
                selection_typeSpecimen.setEntity(entity.getTypeSpecimen());
 
-               SpecimenTypeDesignationStatus typeStatus = (SpecimenTypeDesignationStatus) HibernateProxyHelper
-                               .deproxy(entity.getTypeStatus());
+               SpecimenTypeDesignationStatus typeStatus = HibernateProxyHelper
+                               .deproxy(entity.getTypeStatus(), SpecimenTypeDesignationStatus.class);
                combo_typeStatus.setSelection(typeStatus);
                checkbox_notDesignated.setSelection(entity.isNotDesignated());
        }
@@ -101,8 +77,8 @@ public class SpecimenTypeDesignationElement extends
                else if (eventSource == text_specimenTypeText) {
                        // TODO this is a simple workaround to enter type specimen as text
                        // strings
-                       if (getEntity().getTypeSpecimen() == null) {                            
-                               DerivedUnit typeSpecimen = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);                                                                        
+                       if (getEntity().getTypeSpecimen() == null) {
+                               DerivedUnit typeSpecimen = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
                                getEntity().setTypeSpecimen(typeSpecimen);
                        }
                        getEntity().getTypeSpecimen().setTitleCache(
@@ -116,9 +92,6 @@ public class SpecimenTypeDesignationElement extends
                } else if (eventSource == text_referenceDetail) {
                        getEntity().setCitationMicroReference(
                                        text_referenceDetail.getText());
-               } else if (eventSource == text_originaleNameString) {
-                       getEntity().setOriginalNameString(
-                                       text_originaleNameString.getText());
                }
        }
 }