with cdmLibrary
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 4 Sep 2007 17:39:11 +0000 (17:39 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 4 Sep 2007 17:39:11 +0000 (17:39 +0000)
META-INF/MANIFEST.MF
plugin.xml
src/eu/etaxonomy/taxeditor/SimpleModel.java
taxeditor.product

index 2fd835a..604f387 100644 (file)
@@ -6,6 +6,7 @@ Bundle-Version: 1.0.0
 Bundle-Activator: eu.etaxonomy.taxeditor.Activator
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
- org.eclipse.ui.forms
+ org.eclipse.ui.forms,
+ eu.etaxonomy.cdmLibrary
 Eclipse-LazyStart: true
 Export-Package: eu.etaxonomy.taxeditor
index 2ecd498..3a9a4fd 100644 (file)
             name="Taxonomic Editor">\r
          <property\r
                name="aboutText"\r
-               value="Taxonomic Editor &#x0A;(c) 2007 European Distributed Institute of Taxonomy&#x0A;&#x0A;Thanks to our worldwide fan community and Jesus.">\r
+               value="Taxonomic Editor &#x0A;(c) 2007 European Distributed Institute of Taxonomy&#x0A;&#x0A;Thanks to our worldwide fan community.">\r
          </property>\r
          <property\r
                name="windowImages"\r
index e7f1b49..7ae0679 100644 (file)
@@ -1,8 +1,12 @@
 package eu.etaxonomy.taxeditor;\r
 \r
 import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import eu.etaxonomy.cdm.model.name.TaxonName;\r
+import eu.etaxonomy.cdm.api.service.*;\r
+import eu.etaxonomy.cdm.api.application.CdmApplicationController;\r
 \r
-//import eu.etaxonomy.cdm.model.name.TaxonName;\r
 \r
 public class SimpleModel {\r
        private ArrayList modelListeners;\r
@@ -28,26 +32,40 @@ public class SimpleModel {
                return objects.toArray();\r
        }\r
        private void initialize() {\r
-               /*objects = new ArrayList<TaxonName>();\r
-               TaxonName tn = new TaxonName();\r
-               NameService ns = new NameService();\r
-               objects.add(ns.getTaxonNameById(1));\r
-               objects.add(ns.getTaxonNameById(5));\r
-               objects.add(ns.getTaxonNameById(28));*/\r
-               \r
-               objects = new ArrayList();\r
-               NamedObject[] objects = {\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)*/}; //$NON-NLS-1$\r
-               add(objects, false);\r
+               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
+                       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
+               } 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
        }\r
        public void add(NamedObject[] objs, boolean notify) {\r
                for (int i = 0; i < objs.length; i++) {\r
index ba76be2..6e8a254 100644 (file)
@@ -6,9 +6,9 @@
    <aboutInfo>\r
       <image path="logo_edit.gif"/>\r
       <text>\r
-         Taxonomic Editor \r
-(c) 2007 European Distributed Institute of Taxonomy\r
-\r
+         Taxonomic Editor 
+(c) 2007 European Distributed Institute of Taxonomy
+
 Thanks to our worldwide fan community.\r
       </text>\r
    </aboutInfo>\r
@@ -35,12 +35,12 @@ Thanks to our worldwide fan community.
       </win>\r
    </launcher>\r
 \r
-\r
    <vm>\r
    </vm>\r
 \r
    <plugins>\r
       <plugin id="com.ibm.icu"/>\r
+      <plugin id="eu.etaxonomy.cdmLibrary"/>\r
       <plugin id="eu.etaxonomy.taxeditor"/>\r
       <plugin id="javax.servlet"/>\r
       <plugin id="org.eclipse.core.commands"/>\r