fix #6330 Add default sorting for all entity collections
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / section / key / TaxonomicScopeSection.java
index 76f96121f61d94e812f6ec2abf8e62408a66121d..2638273fa33b1362352655771d4af83929124057 100644 (file)
@@ -1,8 +1,8 @@
 /**
  * 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.
  */
@@ -10,6 +10,7 @@
 package eu.etaxonomy.taxeditor.ui.section.key;
 
 import java.util.Collection;
+import java.util.Comparator;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
@@ -18,6 +19,7 @@ import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonBaseSelectionDialog;
 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;
 
 /**
  * @author n.hoffmann
@@ -43,7 +45,7 @@ public class TaxonomicScopeSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * getCollection(java.lang.Object)
         */
@@ -52,23 +54,28 @@ public class TaxonomicScopeSection extends
                return entity.getTaxonomicScope();
        }
 
+       @Override
+       public Comparator<Taxon> getComparator() {
+        return new DefaultCdmBaseComparator<>();
+       }
+
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * createNewElement()
         */
        @Override
        public Taxon createNewElement() {
-               Taxon selection = TaxonBaseSelectionDialog.selectTaxon(getShell(),
-                               getConversationHolder(), null);
+               Taxon selection = TaxonBaseSelectionDialog.selectTaxon(getShell(),//getConversationHolder(),
+                       null);
 
                return selection;
        }
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement
         * (java.lang.Object)
@@ -80,7 +87,7 @@ public class TaxonomicScopeSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * removeElement(java.lang.Object)
         */
@@ -91,7 +98,7 @@ public class TaxonomicScopeSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * getEmptyString()
         */
@@ -102,7 +109,7 @@ public class TaxonomicScopeSection extends
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
         * getTooltipString()
         */
@@ -111,4 +118,22 @@ public class TaxonomicScopeSection extends
                return "Add a taxon to the scope of this key";
        }
 
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Taxon addExisting() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean allowAddExisting() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
 }