.
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 5 Sep 2007 15:39:23 +0000 (15:39 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 5 Sep 2007 15:39:23 +0000 (15:39 +0000)
src/eu/etaxonomy/taxeditor/SimpleModel.java

index 7ae0679..2ac8cd8 100644 (file)
@@ -35,34 +35,39 @@ public class SimpleModel {
                try {\r
                        //TODO Andreas\r
                        List<TaxonName> tnList = new ArrayList<TaxonName>();\r
-                       TaxonName tn = new TaxonName();\r
                        CdmApplicationController app = new CdmApplicationController();\r
                        NameService ns = app.getNameService();\r
-                       tnList.add(ns.getTaxonNameById(1));\r
-                       tnList.add(ns.getTaxonNameById(4));\r
-                       tnList.add(ns.getTaxonNameById(28));\r
-\r
+                       tnList = ns.getAllNames();\r
+                       \r
                        objects = new ArrayList();\r
-                       NamedObject[] objects = {\r
-                                       new Name(tnList.get(0).getName(), tnList.get(0).getGenus(),tnList.get(0).getInfraSpecificEpithet()),\r
-                                       new Name(tnList.get(1).getName(), tnList.get(1).getGenus(),tnList.get(1).getInfraSpecificEpithet()),\r
-                                       new Name(tnList.get(2).getName(), tnList.get(2).getGenus(),tnList.get(2).getInfraSpecificEpithet()),\r
-                                       \r
-                                       new Name("Pilosella piloselloides (Vill.) Soják", "Pilosella", "piloselloides"),\r
-                                       new Name("Pilosella pavichii (Heuff.) Arv.-Touv.", "Pilosella", "pavichii"), \r
-                                       new Name("Pilosella vahlii (Froel.) F. W. Schultz & Sch. Bip.", "Pilosella", "vahlii")  \r
-                                       /*new TypeOne(Messages.getString("SimpleModel.t1_i1"), 2, true, Messages.getString("SimpleModel.text1")), //$NON-NLS-1$ //$NON-NLS-2$\r
-                                       new TypeOne(Messages.getString("SimpleModel.t1_i2"), 1, false, Messages.getString("SimpleModel.text2")), //$NON-NLS-1$ //$NON-NLS-2$\r
-                                       new TypeOne(Messages.getString("SimpleModel.t1_i3"), 3, true, Messages.getString("SimpleModel.text3")), //$NON-NLS-1$ //$NON-NLS-2$\r
-                                       new TypeOne(Messages.getString("SimpleModel.t1_i4"), 0, false, Messages.getString("SimpleModel.text4")), //$NON-NLS-1$ //$NON-NLS-2$\r
-                                       new TypeOne(Messages.getString("SimpleModel.t1_i5"), 1, true, Messages.getString("SimpleModel.text5")), //$NON-NLS-1$ //$NON-NLS-2$\r
-                                       new TypeTwo(Messages.getString("SimpleModel.t2_i1"), false, true), //$NON-NLS-1$\r
-                                       new TypeTwo(Messages.getString("SimpleModel.t2_i2"), true, false)*/\r
-                       }; //$NON-NLS-1$\r
-                       add(objects, false);\r
+                       for (TaxonName tn: tnList){\r
+                               NamedObject[] objects = {\r
+                                               new Name(tn.getName(), tn.getGenus(),tn.getSpecificEpithet())\r
+                               };\r
+                                               \r
+                               \r
+//                             NamedObject[] objects = {\r
+//                                             new Name(tnList.get(0).getName(), tnList.get(0).getGenus(),tnList.get(0).getInfraSpecificEpithet()),\r
+//                                             new Name(tnList.get(1).getName(), tnList.get(1).getGenus(),tnList.get(1).getInfraSpecificEpithet()),\r
+//                                             new Name(tnList.get(2).getName(), tnList.get(2).getGenus(),tnList.get(2).getInfraSpecificEpithet()),\r
+//                                             \r
+//                                             new Name("Pilosella piloselloides (Vill.) Soják", "Pilosella", "piloselloides"),\r
+//                                             new Name("Pilosella pavichii (Heuff.) Arv.-Touv.", "Pilosella", "pavichii"), \r
+//                                             new Name("Pilosella vahlii (Froel.) F. W. Schultz & Sch. Bip.", "Pilosella", "vahlii")  \r
+//                                             /*new TypeOne(Messages.getString("SimpleModel.t1_i1"), 2, true, Messages.getString("SimpleModel.text1")), //$NON-NLS-1$ //$NON-NLS-2$\r
+//                                             new TypeOne(Messages.getString("SimpleModel.t1_i2"), 1, false, Messages.getString("SimpleModel.text2")), //$NON-NLS-1$ //$NON-NLS-2$\r
+//                                             new TypeOne(Messages.getString("SimpleModel.t1_i3"), 3, true, Messages.getString("SimpleModel.text3")), //$NON-NLS-1$ //$NON-NLS-2$\r
+//                                             new TypeOne(Messages.getString("SimpleModel.t1_i4"), 0, false, Messages.getString("SimpleModel.text4")), //$NON-NLS-1$ //$NON-NLS-2$\r
+//                                             new TypeOne(Messages.getString("SimpleModel.t1_i5"), 1, true, Messages.getString("SimpleModel.text5")), //$NON-NLS-1$ //$NON-NLS-2$\r
+//                                             new TypeTwo(Messages.getString("SimpleModel.t2_i1"), false, true), //$NON-NLS-1$\r
+//                                             new TypeTwo(Messages.getString("SimpleModel.t2_i2"), true, false)*/\r
+//                             }; //$NON-NLS-1$\r
+                               \r
+                               \r
+                               add(objects, false);\r
+                       }\r
                } catch (RuntimeException e) {\r
                        //logger.error("Error when initializing SimpleModel");\r
-                       // TODO Auto-generated catch block\r
                        System.out.println(e.getMessage());\r
                        e.printStackTrace();\r
                }\r