- DefinedTerm is ordered as in enum (#3752)
authorPatric Plitzner <p.plitzner@bgbm.org>
Wed, 23 Oct 2013 09:00:59 +0000 (09:00 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Wed, 23 Oct 2013 09:00:59 +0000 (09:00 +0000)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/OccurrenceCreator.java

index db3d60f776b4b2015942532c7880ad0f99f78f6d..372bdfcd089c3182059d75c656de540ef2ae94b7 100644 (file)
@@ -1,17 +1,15 @@
 // $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.bulkeditor.input.entitycreator;
 
-import java.util.Comparator;
-import java.util.HashMap;
 import java.util.Map;
 import java.util.TreeMap;
 
@@ -30,7 +28,7 @@ import eu.etaxonomy.taxeditor.newWizard.NewDerivedUnitBaseWizard;
  * <p>
  * OccurrenceCreator class.
  * </p>
- * 
+ *
  * @author n.hoffmann
  * @created Jun 16, 2010
  * @version 1.0
@@ -50,7 +48,7 @@ public class OccurrenceCreator implements
        /** {@inheritDoc} */
        @Override
        public SpecimenOrObservationBase createEntity(Object key, String text) {
-               
+
                SpecimenOrObservationBase specimenOrObservation = null;
                NewDerivedUnitBaseWizard wizard = new NewDerivedUnitBaseWizard((SpecimenOrObservationType)key);
                wizard.init(null, null);
@@ -59,9 +57,9 @@ public class OccurrenceCreator implements
                        int status = dialog.open();
 
                        if (status == IStatus.OK) {
-                               specimenOrObservation = wizard.getEntity();                                                             
+                               specimenOrObservation = wizard.getEntity();
                        }
-               } 
+               }
                return specimenOrObservation;
        }
 
@@ -69,22 +67,24 @@ public class OccurrenceCreator implements
         * <p>
         * getKeyLabelPairs
         * </p>
-        * 
+        *
         * @return a {@link java.util.Map} object.
         */
        @Override
        public Map<Object, String> getKeyLabelPairs() {
-               Comparator<Object> comparator = new Comparator<Object>() {
-                         public int compare(Object o1, Object o2) {
-                           String key1 = ((SpecimenOrObservationType)o1).getKey();
-                           String key2 = ((SpecimenOrObservationType)o2).getKey();
-                           return key1.compareTo(key2);
-                         }
-                       };
-               Map<Object, String> result = new TreeMap<Object, String>(comparator);
-
-               for(SpecimenOrObservationType sooType : SpecimenOrObservationType.values()) {                           
-                       result.put(sooType, sooType.getMessage());                              
+//             Comparator<Object> comparator = new Comparator<Object>() {
+//                       public int compare(Object o1, Object o2) {
+//                         String key1 = ((SpecimenOrObservationType)o1).getKey();
+//                         String key2 = ((SpecimenOrObservationType)o2).getKey();
+//                         return key1.compareTo(key2);
+//                       }
+//                     };
+//             Map<Object, String> result = new TreeMap<Object, String>(comparator);
+//         Map<Object, String> result = new HashMap<Object, String>();
+               Map<Object, String> result = new TreeMap<Object, String>();
+
+               for(SpecimenOrObservationType sooType : SpecimenOrObservationType.values()) {
+                       result.put(sooType, sooType.getMessage());
                }
 
                return result;
@@ -95,6 +95,6 @@ public class OccurrenceCreator implements
                // TODO Auto-generated method stub
                return true;
        }
-       
+
 
 }