Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / description / DescribedSpecimenSection.java
index 408b0bbe20e3f8726f8840077ac9ace734c0bb79..a2651e253d36996022b4d04b7eeaef230d55dbed 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.
 */
@@ -18,9 +17,9 @@ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.dialog.selection.DerivedUnitSelectionDialog;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
 
 /**
@@ -45,24 +44,24 @@ public class DescribedSpecimenSection extends AbstractEntityCollectionSection<Ta
                        int style) {
                super(formFactory, conversation, parentElement, "Described Specimen", style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public Collection<SpecimenOrObservationBase> getCollection(
                        TaxonDescription entity) {
-               //FIXME:This class is not really an entity collection section, and should be moved 
+               //FIXME:This class is not really an entity collection section, and should be moved
                // to a single entity section, but one with the possibility of launching a wizard
                List<SpecimenOrObservationBase> collection = new ArrayList<SpecimenOrObservationBase>();
                if(entity.getDescribedSpecimenOrObservation() != null) {
-                       collection.add(entity.getDescribedSpecimenOrObservation());     
-               }               
+                       collection.add(entity.getDescribedSpecimenOrObservation());
+               }
                return collection;
        }
 
        /** {@inheritDoc} */
        @Override
        public SpecimenOrObservationBase createNewElement() {
-               DerivedUnit selection = DerivedUnitSelectionDialog.select(getShell(), getConversationHolder(), null);           
+               DerivedUnit selection = DerivedUnitSelectionDialog.select(getShell(), getConversationHolder(), null);
                return selection;
        }
 
@@ -75,7 +74,7 @@ public class DescribedSpecimenSection extends AbstractEntityCollectionSection<Ta
        /** {@inheritDoc} */
        @Override
        public void removeElement(SpecimenOrObservationBase element) {
-               getEntity().setDescribedSpecimenOrObservation(null);            
+               getEntity().setDescribedSpecimenOrObservation(null);
        }
 
        /** {@inheritDoc} */
@@ -89,4 +88,20 @@ public class DescribedSpecimenSection extends AbstractEntityCollectionSection<Ta
        protected String getTooltipString() {
                return "Add a described specimen.";
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public SpecimenOrObservationBase addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }