Commit before deleting.
authorp.ciardelli <p.ciardelli@localhost>
Wed, 24 Jun 2009 13:26:17 +0000 (13:26 +0000)
committerp.ciardelli <p.ciardelli@localhost>
Wed, 24 Jun 2009 13:26:17 +0000 (13:26 +0000)
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/model/NameRelationsUtil.java

index 1c9cea7b17fc1e99d309c3b8cd59b19c1f8517c9..c7c4ca186fa53fb4335bee237cc4da064e8b747a 100644 (file)
@@ -14,6 +14,7 @@ import java.util.SortedSet;
 \r
 import eu.etaxonomy.cdm.model.name.NameRelationshipType;\r
 import eu.etaxonomy.cdm.model.name.NomenclaturalCode;\r
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;\r
 import eu.etaxonomy.taxeditor.store.CdmStore;\r
 \r
@@ -23,68 +24,70 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @version 1.0\r
  */\r
 public class NameRelationsUtil {\r
-       \r
-       /**\r
-        * Get the type's label out of the session's name relations vocabulary, not directly\r
-        * from the object. \r
-        * \r
-        * @param type\r
-        * @return\r
-        */\r
-       public static String getNameRelationTypeLabel(NameRelationshipType type) {\r
-               boolean isZoological = \r
-                       PreferencesUtil.getPreferredNomenclaturalCode() \r
-                                       == NomenclaturalCode.ICZN ?     true : false;\r
-               return getNameRelationTypeLabel(type, isZoological);\r
-       }\r
-       \r
-       public static String getNameRelationTypeLabel(NameRelationshipType type, boolean isZoological) {\r
-\r
-               SortedSet<NameRelationshipType> vocab = \r
-                               CdmStore.getDefault().getNameRelationshipTypes();\r
-               \r
+//     \r
+//     /**\r
+//      * Get the type's label out of the session's name relations vocabulary, not directly\r
+//      * from the object. \r
+//      * \r
+//      * @param type\r
+//      * @return\r
+//      */\r
+//     public static String getNameRelationTypeLabel(NameRelationshipType type) {\r
+//             boolean isZoological = \r
+//                     PreferencesUtil.getPreferredNomenclaturalCode() \r
+//                                     == NomenclaturalCode.ICZN ?     true : false;\r
+//             return getNameRelationTypeLabel(type, isZoological);\r
+//     }\r
+//\r
+//     public static String getNameRelationTypeLabel(NameRelationshipType type, TaxonNameBase name) {\r
+//             boolean zoological = (name.getNomenclaturalCode().equals(NomenclaturalCode.ICZN));\r
+//             return getNameRelationTypeLabel(type, zoological);\r
+//     }\r
+//     \r
+//     private static String getNameRelationTypeLabel(NameRelationshipType type,\r
+//                     boolean isZoological) {\r
+//\r
 //             SortedSet<NameRelationshipType> vocab = \r
-//                             CdmSessionDataRepository.getDefault().getNameRelationshipTypes();\r
-               for (NameRelationshipType type1 : vocab) {\r
-                       if (type1.equals(type)) {\r
-                               \r
-                               if (isZoological && \r
-                                               type1.equals(NameRelationshipType.BASIONYM())) {\r
-                                       return "original combination for";\r
-                               } else {\r
-                                       return type1.getLabel();\r
-                               }\r
-                       }\r
-               }\r
-               return "";\r
-       }\r
-\r
-       /**\r
-        * Get the inverse representation of the type out of the session's \r
-        * name relations vocabulary, not directly from the object. \r
-        * \r
-        * @param type\r
-        * @return\r
-        */\r
-       public static String getNameRelationInverseTypeLabel(NameRelationshipType type) {\r
-               boolean isZoological = \r
-                       PreferencesUtil.getPreferredNomenclaturalCode() \r
-                                       == NomenclaturalCode.ICZN ?     true : false;\r
-               return getNameRelationInverseTypeLabel(type, isZoological);\r
-       }\r
-       \r
-       public static String getNameRelationInverseTypeLabel(NameRelationshipType type, boolean isZoological) {\r
-\r
-               SortedSet<NameRelationshipType> vocab = \r
-                               CdmStore.getDefault().getNameRelationshipTypes();\r
-               \r
+//                             CdmStore.getDefault().getNameRelationshipTypes();\r
+//             \r
+//             for (NameRelationshipType type1 : vocab) {\r
+//                     if (type1.equals(type)) {\r
+//                             \r
+//                             if (isZoological && \r
+//                                             type1.equals(NameRelationshipType.BASIONYM())) {\r
+//                                     return "original combination for";\r
+//                             } else {\r
+//                                     return type1.getLabel();\r
+//                             }\r
+//                     }\r
+//             }\r
+//             return "";\r
+//     }\r
+//\r
+//     /**\r
+//      * Get the inverse representation of the type out of the session's \r
+//      * name relations vocabulary, not directly from the object. \r
+//      * \r
+//      * @param type\r
+//      * @return\r
+//      */\r
+//     public static String getNameRelationInverseTypeLabel(NameRelationshipType type) {\r
+//             boolean isZoological = \r
+//                     PreferencesUtil.getPreferredNomenclaturalCode() \r
+//                                     == NomenclaturalCode.ICZN ?     true : false;\r
+//             return getNameRelationInverseTypeLabel(type, isZoological);\r
+//     }\r
+//     \r
+//     public static String getNameRelationInverseTypeLabel(NameRelationshipType type, boolean isZoological) {\r
+//\r
 //             SortedSet<NameRelationshipType> vocab = \r
-//                             CdmSessionDataRepository.getDefault().getNameRelationshipTypes();\r
-               for (NameRelationshipType type1 : vocab) {\r
-                       if (type1.equals(type)) {\r
-                               return type1.getInverseLabel();\r
-                       }\r
-               }\r
-               return "";\r
-       }\r
+//                             CdmStore.getDefault().getNameRelationshipTypes();\r
+//             \r
+//             for (NameRelationshipType type1 : vocab) {\r
+//                     if (type1.equals(type)) {\r
+//                             return type1.getInverseLabel();\r
+//                     }\r
+//             }\r
+//             return "";\r
+//     }\r
 }\r