add default comparator to all term combos without own comparator
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / description / GeoScopeSection.java
index c4648506519ff16109674605d1e06cd093dbb677..60533aade97f84a17ebc2098aa1f6548158f6b60 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.
 */
 package eu.etaxonomy.taxeditor.ui.section.description;
 
 import java.util.Collection;
+import java.util.Comparator;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.location.NamedArea;
-import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
+import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
  * <p>GeoScopeSection class.</p>
@@ -27,7 +28,7 @@ import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
  * @version 1.0
  */
 public class GeoScopeSection extends AbstractEntityCollectionSection<TaxonDescription, NamedArea> {
-       
+
        /**
         * <p>Constructor for GeoScopeSection.</p>
         *
@@ -40,13 +41,18 @@ public class GeoScopeSection extends AbstractEntityCollectionSection<TaxonDescri
                        ConversationHolder conversation, ICdmFormElement parentElement, int style) {
                super(formFactory, conversation, parentElement, "Geo Scope", style);
        }
-       
+
        /** {@inheritDoc} */
        @Override
        public Collection<NamedArea> getCollection(TaxonDescription entity) {
                return entity.getGeoScopes();
        }
 
+       @Override
+       public Comparator<NamedArea> getComparator() {
+        return new DefaultCdmBaseComparator<>();
+       }
+
        /** {@inheritDoc} */
        @Override
        public NamedArea createNewElement() {
@@ -76,4 +82,20 @@ public class GeoScopeSection extends AbstractEntityCollectionSection<TaxonDescri
        protected String getTooltipString() {
                return "Add a new geo scope.";
        }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public NamedArea addExisting() {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        return false;
+    }
 }