Merge branch 'develop' into taxonDescription
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / model / NomenclaturalCodeHelper.java
index 2bfcb79393531922391a697c7bd95ed96566b01b..692312d0bdec2bcf9b95cbbc418178ca6ec8d2bc 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.
 */
@@ -15,6 +14,7 @@ import java.util.Arrays;
 import java.util.List;
 
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 
 /**
  * <p>NomenclaturalCodeHelper class.</p>
@@ -24,7 +24,7 @@ import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
  * @version 1.0
  */
 public class NomenclaturalCodeHelper {
-               
+
        /**
         * <p>getAllCodes</p>
         *
@@ -44,12 +44,16 @@ public class NomenclaturalCodeHelper {
                List<NomenclaturalCode> supportedCodes = new ArrayList<NomenclaturalCode>();
                for (NomenclaturalCode code : getAllCodes()) {
                        if (isSupported(code)) {
-                               supportedCodes.add(code);
+                           if (PreferencesUtil.getPreferredNomenclaturalCode(false).equals(code)){
+                               supportedCodes.add(0, code);
+                           }else{
+                               supportedCodes.add(code);
+                           }
                        }
                }
                return supportedCodes;
        }
-       
+
        /**
         * @param code
         * @return
@@ -81,13 +85,13 @@ public class NomenclaturalCodeHelper {
                }
                if (code.equals(NomenclaturalCode.ICZN)) {
                        return "International Code of Zoological Nomenclature (ICZN)";
-               }               
+               }
                if (code.equals(NomenclaturalCode.ICVCN)) {
                        return "International Code for Virus Classification and Nomenclature (ICVCN)";
-               } 
+               }
                return code.name();
        }
-       
+
        /**
         * <p>getDefaultCode</p>
         *