Mockup with Master-Details page.
authorp.ciardelli <p.ciardelli@localhost>
Thu, 30 Aug 2007 09:03:33 +0000 (09:03 +0000)
committerp.ciardelli <p.ciardelli@localhost>
Thu, 30 Aug 2007 09:03:33 +0000 (09:03 +0000)
30 files changed:
.gitattributes
META-INF/MANIFEST.MF
plugin.properties [new file with mode: 0644]
plugin.xml
plugin_customization.ini [new file with mode: 0644]
splash.bmp
src/eu/etaxonomy/taxeditor/Activator.java
src/eu/etaxonomy/taxeditor/ApplicationActionBarAdvisor.java
src/eu/etaxonomy/taxeditor/ApplicationWorkbenchWindowAdvisor.java
src/eu/etaxonomy/taxeditor/FormEditorInput.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/FormView.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/ICommandIds.java
src/eu/etaxonomy/taxeditor/IModelListener.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/MasterDetailsPage.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/MessagePopupAction.java
src/eu/etaxonomy/taxeditor/Messages.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/Name.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/NameDetailsPage.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/NamedObject.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/OpenFormEditorAction.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/OpenSimpleFormEditorAction.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/OpenViewAction.java
src/eu/etaxonomy/taxeditor/Perspective.java
src/eu/etaxonomy/taxeditor/ScrolledPropertiesBlock.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/SimpleFormEditor.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/SimpleFormEditorInput.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/SimpleModel.java [new file with mode: 0644]
src/eu/etaxonomy/taxeditor/View.java
src/eu/etaxonomy/taxeditor/messages.properties [new file with mode: 0644]
taxeditor.product [new file with mode: 0644]

index a18d3dd..682479c 100644 (file)
@@ -8,17 +8,35 @@ icons/sample.gif -text
 icons/sample.icns -text
 icons/sample2.gif -text
 icons/sample3.gif -text
+/plugin.properties -text
 /plugin.xml -text
+/plugin_customization.ini -text
 /product_lg.gif -text
 /splash.bmp -text
 src/eu/etaxonomy/taxeditor/Activator.java -text
 src/eu/etaxonomy/taxeditor/ApplicationActionBarAdvisor.java -text
 src/eu/etaxonomy/taxeditor/ApplicationWorkbenchAdvisor.java -text
 src/eu/etaxonomy/taxeditor/ApplicationWorkbenchWindowAdvisor.java -text
+src/eu/etaxonomy/taxeditor/FormEditorInput.java -text
+src/eu/etaxonomy/taxeditor/FormView.java -text
 src/eu/etaxonomy/taxeditor/ICommandIds.java -text
+src/eu/etaxonomy/taxeditor/IModelListener.java -text
+src/eu/etaxonomy/taxeditor/MasterDetailsPage.java -text
 src/eu/etaxonomy/taxeditor/MessagePopupAction.java -text
+src/eu/etaxonomy/taxeditor/Messages.java -text
+src/eu/etaxonomy/taxeditor/Name.java -text
+src/eu/etaxonomy/taxeditor/NameDetailsPage.java -text
+src/eu/etaxonomy/taxeditor/NamedObject.java -text
 src/eu/etaxonomy/taxeditor/NavigationView.java -text
+src/eu/etaxonomy/taxeditor/OpenFormEditorAction.java -text
+src/eu/etaxonomy/taxeditor/OpenSimpleFormEditorAction.java -text
 src/eu/etaxonomy/taxeditor/OpenViewAction.java -text
 src/eu/etaxonomy/taxeditor/Perspective.java -text
+src/eu/etaxonomy/taxeditor/ScrolledPropertiesBlock.java -text
+src/eu/etaxonomy/taxeditor/SimpleFormEditor.java -text
+src/eu/etaxonomy/taxeditor/SimpleFormEditorInput.java -text
+src/eu/etaxonomy/taxeditor/SimpleModel.java -text
 src/eu/etaxonomy/taxeditor/TaxEditorApplication.java -text
 src/eu/etaxonomy/taxeditor/View.java -text
+src/eu/etaxonomy/taxeditor/messages.properties -text
+/taxeditor.product -text
index 85be423..a3fb886 100644 (file)
@@ -5,5 +5,6 @@ Bundle-SymbolicName: eu.etaxonomy.taxeditor; singleton:=true
 Bundle-Version: 1.0.0
 Bundle-Activator: eu.etaxonomy.taxeditor.Activator
 Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
+ org.eclipse.core.runtime,
+ org.eclipse.ui.forms
 Eclipse-LazyStart: true
diff --git a/plugin.properties b/plugin.properties
new file mode 100644 (file)
index 0000000..86039f9
--- /dev/null
@@ -0,0 +1,18 @@
+###############################################################################\r
+# Copyright (c) 2003, 2004 IBM Corporation and others.\r
+# All rights reserved. This program and the accompanying materials\r
+# are made available under the terms of the Common Public License v1.0\r
+# which accompanies this distribution, and is available at\r
+# http://www.eclipse.org/legal/cpl-v10.html\r
+# \r
+# Contributors:\r
+#     IBM Corporation - initial API and implementation\r
+###############################################################################\r
+pluginName = Eclipse Forms Article Source Code\r
+providerName = Eclipse.org\r
+actionSetName = Eclipse Forms Article\r
+menuLabel = Form Article Editors\r
+actionLabel = Simple Form Editor\r
+categoryName = Eclipse Forms Article Examples\r
+viewName = Eclipse Form\r
+baseEditor = Simple Form (RCP) Editor
\ No newline at end of file
index 4b3648b..e9016db 100644 (file)
             id="eu.etaxonomy.taxeditor.perspective">\r
       </perspective>\r
    </extension>\r
+   \r
+   <extension\r
+         point="org.eclipse.ui.editors">\r
+      <editor\r
+            name="Names"\r
+            default="true"\r
+            icon="icons/file_obj.gif"\r
+            class="eu.etaxonomy.taxeditor.SimpleFormEditor"\r
+            id="eu.etaxonomy.taxeditor.base-editor">\r
+      </editor>\r
+   </extension>\r
+   <extension\r
+         point="org.eclipse.ui.actionSets">\r
+      <actionSet\r
+            label="Master Details Actionset"\r
+            id="eu.etaxonomy.taxeditor.actionSet">\r
+         <menu\r
+               label="Names Demo"\r
+               id="eu.etaxonomy.taxeditor.menu">\r
+            <groupMarker\r
+                  name="group">\r
+            </groupMarker>\r
+         </menu>\r
+         <action\r
+               label="Open"\r
+               class="eu.etaxonomy.taxeditor.OpenSimpleFormEditorAction"\r
+               menubarPath="eu.etaxonomy.taxeditor.menu/file"\r
+               id="eu.etaxonomy.taxeditor.simple">\r
+         </action>\r
+      </actionSet>\r
+   </extension>   \r
+   \r
    <extension\r
          point="org.eclipse.ui.views">\r
       <view\r
             class="eu.etaxonomy.taxeditor.NavigationView"\r
             id="eu.etaxonomy.taxeditor.navigationView">\r
       </view>\r
+      <view\r
+            name="Name Form"\r
+            allowMultiple="true"\r
+            icon="icons/sample3.gif"\r
+            class="eu.etaxonomy.taxeditor.FormView"\r
+            id="eu.etaxonomy.taxeditor.formview">\r
+      </view>      \r
    </extension>\r
    <extension\r
          point="org.eclipse.ui.commands">\r
             name="Taxonomic Editor">\r
          <property\r
                name="aboutText"\r
-               value="RCP Mail template created by PDE">\r
+               value="Taxonomic Editor &#x0A;(c) 2007 European Distributed Institute of Taxonomy&#x0A;&#x0A;Thanks to our worldwide fan community and Jesus.">\r
          </property>\r
          <property\r
                name="windowImages"\r
-               value="icons/sample2.gif">\r
+               value="icons/edit_16x16.gif">\r
          </property>\r
          <property\r
                name="aboutImage"\r
-               value="product_lg.gif">\r
+               value="logo_edit.gif">\r
+         </property>\r
+         <property\r
+               name="appName"\r
+               value="Taxonomic Editor">\r
+         </property>\r
+         <property\r
+               name="startupForegroundColor"\r
+               value="000000">\r
+         </property>\r
+         <property\r
+               name="startupMessageRect"\r
+               value="7,252,445,20">\r
+         </property>\r
+         <property\r
+               name="preferenceCustomization"\r
+               value="plugin_customization.ini">\r
          </property>\r
       </product>\r
    </extension>\r
diff --git a/plugin_customization.ini b/plugin_customization.ini
new file mode 100644 (file)
index 0000000..ecdf68e
--- /dev/null
@@ -0,0 +1 @@
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true\r
index d7d2e30..74c1225 100644 (file)
Binary files a/splash.bmp and b/splash.bmp differ
index 883be15..3df3ff6 100644 (file)
@@ -1,6 +1,16 @@
 package eu.etaxonomy.taxeditor;\r
 \r
+import java.net.URL;\r
+import java.util.MissingResourceException;\r
+import java.util.ResourceBundle;\r
+\r
+import org.eclipse.core.runtime.IPath;\r
+import org.eclipse.core.runtime.Path;\r
 import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.jface.resource.ImageRegistry;\r
+import org.eclipse.swt.graphics.Image;\r
+import org.eclipse.swt.widgets.Display;\r
+import org.eclipse.ui.forms.FormColors;\r
 import org.eclipse.ui.plugin.AbstractUIPlugin;\r
 import org.osgi.framework.BundleContext;\r
 \r
@@ -34,10 +44,10 @@ public class Activator extends AbstractUIPlugin {
         * (non-Javadoc)\r
         * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)\r
         */\r
-       public void stop(BundleContext context) throws Exception {\r
+       /*public void stop(BundleContext context) throws Exception {\r
                plugin = null;\r
                super.stop(context);\r
-       }\r
+       }*/\r
 \r
        /**\r
         * Returns the shared instance\r
@@ -55,7 +65,98 @@ public class Activator extends AbstractUIPlugin {
         * @param path the path\r
         * @return the image descriptor\r
         */\r
-       public static ImageDescriptor getImageDescriptor(String path) {\r
+       public static ImageDescriptor getImageDescriptorOrig(String path) {\r
                return imageDescriptorFromPlugin(PLUGIN_ID, path);\r
        }\r
+       \r
+       /**\r
+        * EVERYTHING BELOW HERE WAS PASTED FROM FORMARTICLEPLUGIN.JAVA\r
+        **/\r
+       //Resource bundle.\r
+       private ResourceBundle resourceBundle;\r
+       private FormColors formColors;\r
+       public static final String IMG_FORM_BG = "formBg"; //$NON-NLS-1$\r
+       public static final String IMG_LARGE = "large"; //$NON-NLS-1$\r
+       public static final String IMG_HORIZONTAL = "horizontal"; //$NON-NLS-1$\r
+       public static final String IMG_VERTICAL = "vertical"; //$NON-NLS-1$\r
+       public static final String IMG_SAMPLE = "sample"; //$NON-NLS-1$\r
+       public static final String IMG_WIZBAN = "wizban"; //$NON-NLS-1$\r
+       public static final String IMG_LINKTO_HELP = "linkto_help"; //$NON-NLS-1$\r
+       public static final String IMG_HELP_TOPIC = "help_topic"; //$NON-NLS-1$\r
+       public static final String IMG_CLOSE = "close"; //$NON-NLS-1$\r
+       \r
+       protected void initializeImageRegistry(ImageRegistry registry) {\r
+               registerImage(registry, IMG_FORM_BG, "form_banner.gif"); //$NON-NLS-1$\r
+               registerImage(registry, IMG_LARGE, "large_image.gif"); //$NON-NLS-1$\r
+               registerImage(registry, IMG_HORIZONTAL, "th_horizontal.gif"); //$NON-NLS-1$\r
+               registerImage(registry, IMG_VERTICAL, "th_vertical.gif"); //$NON-NLS-1$\r
+               registerImage(registry, IMG_SAMPLE, "sample.gif"); //$NON-NLS-1$\r
+               registerImage(registry, IMG_WIZBAN, "newprj_wiz.gif"); //$NON-NLS-1$\r
+               registerImage(registry, IMG_LINKTO_HELP, "linkto_help.gif"); //$NON-NLS-1$\r
+               registerImage(registry, IMG_HELP_TOPIC, "help_topic.gif"); //$NON-NLS-1$\r
+               registerImage(registry, IMG_CLOSE, "close_view.gif"); //$NON-NLS-1$\r
+       }\r
+\r
+       private void registerImage(ImageRegistry registry, String key,\r
+                       String fileName) {\r
+               try {\r
+                       IPath path = new Path("icons/" + fileName); //$NON-NLS-1$\r
+                       URL url = find(path);\r
+                       if (url!=null) {\r
+                               ImageDescriptor desc = ImageDescriptor.createFromURL(url);\r
+                               registry.put(key, desc);\r
+                       }\r
+               } catch (Exception e) {\r
+               }\r
+       }\r
+\r
+       public FormColors getFormColors(Display display) {\r
+               if (formColors == null) {\r
+                       formColors = new FormColors(display);\r
+                       formColors.markShared();\r
+               }\r
+               return formColors;\r
+       }\r
+               /**\r
+        * Returns the workspace instance.\r
+        */\r
+/*     public static IWorkspace getWorkspace() {\r
+               return ResourcesPlugin.getWorkspace();\r
+       }*/\r
+       /**\r
+        * Returns the string from the plugin's resource bundle, or 'key' if not\r
+        * found.\r
+        */\r
+       public static String getResourceString(String key) {\r
+               ResourceBundle bundle = Activator.getDefault().getResourceBundle();\r
+               try {\r
+                       return (bundle != null ? bundle.getString(key) : key);\r
+               } catch (MissingResourceException e) {\r
+                       return key;\r
+               }\r
+       }\r
+       /**\r
+        * Returns the plugin's resource bundle,\r
+        */\r
+       public ResourceBundle getResourceBundle() {\r
+               return resourceBundle;\r
+       }\r
+       public void stop(BundleContext context) throws Exception {\r
+               plugin = null;\r
+               try {\r
+                       if (formColors != null) {\r
+                               formColors.dispose();\r
+                               formColors = null;\r
+                       }\r
+               } finally {\r
+                       super.stop(context);\r
+               }\r
+       }\r
+       public Image getImage(String key) {\r
+               return getImageRegistry().get(key);\r
+       }\r
+       public ImageDescriptor getImageDescriptor(String key) {\r
+               return getImageRegistry().getDescriptor(key);\r
+       }\r
+        \r
 }\r
index 7435806..c551a82 100644 (file)
@@ -2,6 +2,7 @@ package eu.etaxonomy.taxeditor;
 
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.ICoolBarManager;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.IToolBarManager;
@@ -54,9 +55,13 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
         newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(window);
         register(newWindowAction);
         
+        // model on this one
         openViewAction = new OpenViewAction(window, "Open Another Message View", View.ID);
         register(openViewAction);
         
+        /*IAction newMasterDetailEditorAction = new IAction(window, "Testy Poo", "eu.etaxonomy.taxeditor.simple");
+        register(newMasterDetailEditorAction);*/
+        
         messagePopupAction = new MessagePopupAction("Open Message", window);
         register(messagePopupAction);
     }
@@ -65,16 +70,20 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
         MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
         MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
         
+        MenuManager testMenu = new MenuManager("&Names Demo", IWorkbenchActionConstants.M_HELP);
+        
         menuBar.add(fileMenu);
         // Add a group marker indicating where action set menus will appear.
         menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
         menuBar.add(helpMenu);
+        //menuBar.add(testMenu);
         
         // File
         fileMenu.add(newWindowAction);
         fileMenu.add(new Separator());
         fileMenu.add(messagePopupAction);
         fileMenu.add(openViewAction);
+        //testMenu.add(openViewAction);
         fileMenu.add(new Separator());
         fileMenu.add(exitAction);
         
index 87f6a8c..5f1aea3 100644 (file)
@@ -18,8 +18,9 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
     
     public void preWindowOpen() {
         IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
-        configurer.setInitialSize(new Point(600, 400));
+        configurer.setInitialSize(new Point(800, 600));
         configurer.setShowCoolBar(true);
+        //configurer.setShowCoolBar(false);
         configurer.setShowStatusLine(false);
     }
     
diff --git a/src/eu/etaxonomy/taxeditor/FormEditorInput.java b/src/eu/etaxonomy/taxeditor/FormEditorInput.java
new file mode 100644 (file)
index 0000000..42f679b
--- /dev/null
@@ -0,0 +1,63 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.ui.IEditorInput;\r
+import org.eclipse.ui.IPersistableElement;\r
+import org.eclipse.ui.ISharedImages;\r
+import org.eclipse.ui.PlatformUI;\r
+\r
+public class FormEditorInput implements IEditorInput {\r
+       private String name;\r
+       public FormEditorInput(String name) {\r
+               this.name = name;\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.IEditorInput#exists()\r
+        */\r
+       public boolean exists() {\r
+               return true;\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.IEditorInput#getImageDescriptor()\r
+        */\r
+       public ImageDescriptor getImageDescriptor() {\r
+               return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(\r
+                               ISharedImages.IMG_OBJ_ELEMENT);\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.IEditorInput#getName()\r
+        */\r
+       public String getName() {\r
+               return name;\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.IEditorInput#getPersistable()\r
+        */\r
+       public IPersistableElement getPersistable() {\r
+               return null;\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.IEditorInput#getToolTipText()\r
+        */\r
+       public String getToolTipText() {\r
+               return getName();\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)\r
+        */\r
+       public Object getAdapter(Class adapter) {\r
+               return null;\r
+       }\r
+}
\ No newline at end of file
diff --git a/src/eu/etaxonomy/taxeditor/FormView.java b/src/eu/etaxonomy/taxeditor/FormView.java
new file mode 100644 (file)
index 0000000..b783459
--- /dev/null
@@ -0,0 +1,317 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import org.eclipse.jface.resource.JFaceResources;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.layout.FillLayout;\r
+import org.eclipse.swt.layout.GridData;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Button;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.eclipse.swt.widgets.Text;\r
+import org.eclipse.ui.forms.FormColors;\r
+import org.eclipse.ui.forms.ManagedForm;\r
+import org.eclipse.ui.forms.events.ExpansionAdapter;\r
+import org.eclipse.ui.forms.events.ExpansionEvent;\r
+import org.eclipse.ui.forms.events.HyperlinkAdapter;\r
+import org.eclipse.ui.forms.events.HyperlinkEvent;\r
+import org.eclipse.ui.forms.widgets.ExpandableComposite;\r
+import org.eclipse.ui.forms.widgets.Form;\r
+import org.eclipse.ui.forms.widgets.FormText;\r
+import org.eclipse.ui.forms.widgets.FormToolkit;\r
+import org.eclipse.ui.forms.widgets.Hyperlink;\r
+import org.eclipse.ui.forms.widgets.ScrolledForm;\r
+import org.eclipse.ui.forms.widgets.Section;\r
+import org.eclipse.ui.forms.widgets.TableWrapData;\r
+import org.eclipse.ui.forms.widgets.TableWrapLayout;\r
+import org.eclipse.ui.part.ViewPart;\r
+\r
+public class FormView extends ViewPart {\r
+       private FormToolkit toolkit;\r
+       // private Form form;\r
+       private ScrolledForm form;\r
+       private ScrolledPropertiesBlock block;\r
+\r
+       public static final String ID = "eu.etaxonomy.taxeditor.formview";\r
+       \r
+       /**\r
+        * The constructor.\r
+        */\r
+       public FormView() {\r
+               /*block = new ScrolledPropertiesBlock();*/\r
+       }\r
+\r
+               /**\r
+        * This is a callback that will allow us to create the viewer and initialize\r
+        * it.\r
+        */\r
+       public void createPartControl(Composite parent) {\r
+               \r
+           toolkit = new FormToolkit(parent.getDisplay());\r
+           Composite container = toolkit.createComposite(parent, SWT.NONE);\r
+           container.setLayout(new FillLayout());\r
+           toolkit.paintBordersFor(container);\r
+\r
+           ScrolledForm form = toolkit.createScrolledForm(container);\r
+           form.getBody().setLayout(new FillLayout());\r
+           form.setText("MasterDetailsBlock example form");\r
+          \r
+           ManagedForm mform = new ManagedForm(toolkit, form) ;   \r
+          \r
+           /*ScrolledPropertiesBlock block = new ScrolledPropertiesBlock();\r
+           block.createContent(mform);*/\r
+          \r
+           //\r
+           /*createActions();\r
+           initializeToolBar();\r
+           initializeMenu();*/ \r
+               \r
+               \r
+               /*toolkit = new FormToolkit(parent.getDisplay());\r
+               form = toolkit.createScrolledForm(parent);*/ \r
+               \r
+/*             TableWrapData td = new TableWrapData();\r
+               Section section = toolkit.createSection(form.getBody(),\r
+                               Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE\r
+                                               | Section.EXPANDED);\r
+               td = new TableWrapData(TableWrapData.FILL);\r
+               td.colspan = 2;\r
+               section.setLayoutData(td);\r
+               section.addExpansionListener(new ExpansionAdapter() {\r
+                       public void expansionStateChanged(ExpansionEvent e) {\r
+                               form.reflow(true);\r
+                       }\r
+               });\r
+               section.setText("Section title");\r
+               section.setDescription("This is the description that goes "\r
+                               + "below the title");\r
+               Composite sectionClient = toolkit.createComposite(section);\r
+               sectionClient.setLayout(new GridLayout());\r
+               section.setClient(sectionClient);\r
+       */      \r
+               \r
+               /*Label label = toolkit.createLabel(form.getBody(), "Text field label:");\r
+               final Text text = toolkit.createText(form.getBody(), "");\r
+               text.setText("value");*/\r
+               /*\r
+               final String[] names = new String[6];\r
+               names[0] = "Pilosella piloselloides (Vill.) Soják subsp. piloselloides";\r
+               names[1] = "Pilosella piloselloides subsp. bauhinii (Schult.) S. Bräut. & Greuter";\r
+               names[2] = "Pilosella piloselloides subsp. floccosa (Nägeli & Peter) S. Bräut. & Greuter";\r
+               names[3] = "Pilosella piloselloides subsp. magyarica (Peter) S. Bräut. & Greuter";\r
+               names[4] = "Pilosella piloselloides subsp. praealta (Gochnat) S. Bräut. & Greuter";\r
+               names[5] = "Pilosella piloselloides subsp. rubrobauhinii (Schelk. & Zahn) S. Bräut. & Greuter";\r
+               \r
+               TableWrapLayout layout = new TableWrapLayout();\r
+               form.getBody().setLayout(layout);\r
+               final Integer j = 1;\r
+               for (int i = 0; i < 5; i++) {\r
+                       Hyperlink link = toolkit.createHyperlink(form.getBody(), names[i],\r
+                                       SWT.WRAP);\r
+                       /*j = (Integer)i;\r
+                       link.addHyperlinkListener(new HyperlinkAdapter() {\r
+                               \r
+                               public void linkActivated(HyperlinkEvent e) {\r
+                                       text.setText(Integer.toString(j));\r
+                               }\r
+                       });\r
+               }*/\r
+               \r
+               /*\r
+\r
+                               \r
+               final Hyperlink link = toolkit.createHyperlink(form.getBody(), "Click here.",\r
+                               SWT.WRAP);\r
+               \r
+               layout.numColumns = 2;\r
+               TableWrapData td = new TableWrapData();\r
+               td.colspan = 2;\r
+               link.setLayoutData(td);\r
+               Label label = toolkit.createLabel(form.getBody(), "Text field label:");\r
+               final Text text = toolkit.createText(form.getBody(), "");\r
+               text.setText("value");\r
+\r
+               final int tester = 2;\r
+               \r
+               link.addHyperlinkListener(new HyperlinkAdapter() {\r
+                       \r
+                       public void linkActivated(HyperlinkEvent e) {\r
+                               text.setText(Integer.toString(tester));\r
+                       }\r
+               });\r
+               */\r
+               /*\r
+               toolkit = new FormToolkit(parent.getDisplay());\r
+               form = toolkit.createScrolledForm(parent); // .createForm(parent); //\r
+               // alternate:\r
+               // createScrolledForm\r
+               form.setText("Hello, Eclipse Forms");\r
+               TableWrapLayout layout = new TableWrapLayout();\r
+               // GridLayout layout = new GridLayout();\r
+               form.getBody().setLayout(layout);\r
+               Hyperlink link = toolkit.createHyperlink(form.getBody(), "Click here.",\r
+                               SWT.WRAP);\r
+               link.addHyperlinkListener(new HyperlinkAdapter() {\r
+                       public void linkActivated(HyperlinkEvent e) {\r
+                               System.out.println("Link activated!");\r
+                       }\r
+               });\r
+               link.setText("This is an example of a form that is much longer "\r
+                               + "and will need to wrap.");\r
+\r
+               layout.numColumns = 2;\r
+               TableWrapData td = new TableWrapData();\r
+               td.colspan = 2;\r
+               link.setLayoutData(td);\r
+\r
+               Label label = toolkit.createLabel(form.getBody(), "Text field label:");\r
+               Text text = toolkit.createText(form.getBody(), "");\r
+\r
+               td = new TableWrapData(TableWrapData.FILL_GRAB);\r
+               text.setLayoutData(td);\r
+\r
+               Button button = toolkit.createButton(form.getBody(),\r
+                               "A checkbox in a form", SWT.CHECK);\r
+               td = new TableWrapData();\r
+               td.colspan = 2;\r
+               button.setLayoutData(td);\r
+\r
+               ExpandableComposite ec = toolkit.createExpandableComposite(form\r
+                               .getBody(), ExpandableComposite.TREE_NODE\r
+                               | ExpandableComposite.CLIENT_INDENT);\r
+               ec.setText("Expandable Composite title");\r
+               String ctext = "We will now create a somewhat long text so that "\r
+                               + "we can use it as content for the expandable composite. "\r
+                               + "Expandable composite is used to hide or show the text using the "\r
+                               + "toggle control";\r
+               Label client = toolkit.createLabel(ec, ctext, SWT.WRAP);\r
+               ec.setClient(client);\r
+               td = new TableWrapData();\r
+               td.colspan = 2;\r
+               ec.setLayoutData(td);\r
+               ec.addExpansionListener(new ExpansionAdapter() {\r
+                       public void expansionStateChanged(ExpansionEvent e) {\r
+                               form.reflow(true);\r
+                       }\r
+               });\r
+\r
+               Section section = toolkit.createSection(form.getBody(),\r
+                               Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE\r
+                                               | Section.EXPANDED);\r
+               td = new TableWrapData(TableWrapData.FILL);\r
+               td.colspan = 2;\r
+               section.setLayoutData(td);\r
+               section.addExpansionListener(new ExpansionAdapter() {\r
+                       public void expansionStateChanged(ExpansionEvent e) {\r
+                               form.reflow(true);\r
+                       }\r
+               });\r
+               section.setText("Section title");\r
+               section.setDescription("This is the description that goes "\r
+                               + "below the title");\r
+               Composite sectionClient = toolkit.createComposite(section);\r
+               sectionClient.setLayout(new GridLayout());\r
+               button = toolkit.createButton(sectionClient, "Radio 1", SWT.RADIO);\r
+               button = toolkit.createButton(sectionClient, "Radio 2", SWT.RADIO);\r
+               section.setClient(sectionClient);\r
+\r
+               StringBuffer buf = new StringBuffer();\r
+               buf.append("<form>");\r
+               buf.append("<p>");\r
+               buf.append("Here is some plain text for the text to render; ");\r
+               buf.append("this text is at <a href=\"http://www.eclipse.org\" "\r
+                               + "nowrap=\"true\">http://www.eclipse.org</a> web site.");\r
+               buf.append("</p>");\r
+               buf.append("<p>");\r
+               buf.append("<span color=\"header\" font=\"header\">"\r
+                               + "This text is in header font and color.</span>");\r
+               buf.append("</p>");\r
+               buf.append("<p>This line will contain some <b>bold</b> and "\r
+                               + "some <span font=\"code\">source</span> text. ");\r
+               buf.append("We can also add <img href=\"image\"/> an image. ");\r
+               buf.append("</p>");\r
+               buf.append("<li>A default (bulleted) list item.</li>");\r
+               buf.append("<li>Another bullet list item.</li>");\r
+               buf\r
+                               .append("<li style=\"text\" value=\"1.\">A list item with text.</li>");\r
+               buf.append("<li style=\"text\" value=\"2.\">Another list "\r
+                               + "item with text</li>");\r
+               buf.append("<li style=\"image\" value=\"image\">List item with "\r
+                               + "an image bullet</li>");\r
+               buf\r
+                               .append("<li style=\"text\" bindent=\"20\" indent=\"40\" value=\"3.\">"\r
+                                               + "A list item with text.</li>");\r
+               buf\r
+                               .append("<li style=\"text\" bindent=\"20\" indent=\"40\" value=\"4.\">"\r
+                                               + "A list item with text.</li>");\r
+               buf.append("<p>     leading blanks;      more white \n\n new "\r
+                               + "lines   <br/>  \n   more <b>   bb   </b>  white  . </p>");\r
+               buf.append("</form>");\r
+               FormText formText = toolkit.createFormText(form.getBody(), true);\r
+               formText.setWhitespaceNormalized(true);\r
+               td = new TableWrapData(TableWrapData.FILL);\r
+               td.colspan = 2;\r
+               formText.setLayoutData(td);\r
+               \r
+               formText.setColor("header", toolkit.getColors().getColor(\r
+                               FormColors.TITLE));\r
+               formText.setFont("header", JFaceResources.getHeaderFont());\r
+               formText.setFont("code", JFaceResources.getTextFont());\r
+               formText.setText(buf.toString(), true, false);\r
+               formText.addHyperlinkListener(new HyperlinkAdapter() {\r
+                       public void linkActivated(HyperlinkEvent e) {\r
+                               System.out.println("Link active: " + e.getHref());\r
+                       }\r
+               });\r
+               */\r
+               \r
+               /* colspan, rowspan demo */\r
+               /*\r
+                * TableWrapLayout layout = new TableWrapLayout(); toolkit = new\r
+                * FormToolkit(parent.getDisplay()); form = toolkit.createForm(parent); //\r
+                * alternate: createScrolledForm form.getBody().setLayout(layout);\r
+                * \r
+                * layout.numColumns = 3; Label label; TableWrapData td;\r
+                * \r
+                * label = toolkit.createLabel(form.getBody(), "Some text to put in the\r
+                * first column", SWT.WRAP); label = toolkit.createLabel(form.getBody(),\r
+                * "Some text to put in the second column and make it a bit "+ "longer\r
+                * so that we can see what happens with column "+ "distribution. This\r
+                * text must be the longest so that it can "+ "get more space allocated\r
+                * to the columns it belongs to.", SWT.WRAP); td = new TableWrapData();\r
+                * td.colspan = 2; label.setLayoutData(td); label =\r
+                * toolkit.createLabel(form.getBody(), "This text will span two rows and\r
+                * should not grow the column.", SWT.WRAP); td = new TableWrapData();\r
+                * td.rowspan = 2; label.setLayoutData(td); label =\r
+                * toolkit.createLabel(form.getBody(), "This text goes into column 2 and\r
+                * consumes only one cell", SWT.WRAP); label.setLayoutData(new\r
+                * TableWrapData(TableWrapData.FILL_GRAB)); label =\r
+                * toolkit.createLabel(form.getBody(), "This text goes into column 3 and\r
+                * consumes only one cell too", SWT.WRAP); label.setLayoutData(new\r
+                * TableWrapData(TableWrapData.FILL)); label =\r
+                * toolkit.createLabel(form.getBody(), "This text goes into column 2 and\r
+                * consumes only one cell", SWT.WRAP); label.setLayoutData(new\r
+                * TableWrapData(TableWrapData.FILL_GRAB)); label =\r
+                * toolkit.createLabel(form.getBody(), "This text goes into column 3 and\r
+                * consumes only one cell too", SWT.WRAP); label.setLayoutData(new\r
+                * TableWrapData(TableWrapData.FILL));\r
+                * form.getBody().setBackground(form.getBody().getDisplay().\r
+                * getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));\r
+                */             \r
+       }\r
+\r
+       /**\r
+        * Passing the focus request to the form.\r
+        */\r
+       public void setFocus() {\r
+               form.setFocus();\r
+       }\r
+\r
+       /**\r
+        * Disposes the toolkit\r
+        */\r
+       public void dispose() {\r
+               toolkit.dispose();\r
+               super.dispose();\r
+       }\r
+}\r
index 349d94c..c405b99 100644 (file)
@@ -11,5 +11,6 @@ public interface ICommandIds {
 
     public static final String CMD_OPEN = "eu.etaxonomy.taxeditor.open";
     public static final String CMD_OPEN_MESSAGE = "eu.etaxonomy.taxeditor.openMessage";
+    public static final String CMD_OPEN_EDITOR = "eu.etaxonomy.taxeditor.openMessage";
     
 }
diff --git a/src/eu/etaxonomy/taxeditor/IModelListener.java b/src/eu/etaxonomy/taxeditor/IModelListener.java
new file mode 100644 (file)
index 0000000..8295b08
--- /dev/null
@@ -0,0 +1,8 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+public interface IModelListener {\r
+       String ADDED="__added"; //$NON-NLS-1$\r
+       String REMOVED="__removed"; //$NON-NLS-1$\r
+       String CHANGED = "__changed"; //$NON-NLS-1$\r
+       void modelChanged(Object[] objects, String type, String property);\r
+}
\ No newline at end of file
diff --git a/src/eu/etaxonomy/taxeditor/MasterDetailsPage.java b/src/eu/etaxonomy/taxeditor/MasterDetailsPage.java
new file mode 100644 (file)
index 0000000..24efd34
--- /dev/null
@@ -0,0 +1,22 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import org.eclipse.ui.forms.IManagedForm;\r
+import org.eclipse.ui.forms.editor.FormEditor;\r
+import org.eclipse.ui.forms.editor.FormPage;\r
+import org.eclipse.ui.forms.widgets.ScrolledForm;\r
+\r
+public class MasterDetailsPage extends FormPage {\r
+       private ScrolledPropertiesBlock block;\r
+       public MasterDetailsPage(FormEditor editor) {\r
+               super(editor, "fourth", Messages.getString("MasterDetailsPage.label")); //$NON-NLS-1$ //$NON-NLS-2$\r
+               block = new ScrolledPropertiesBlock(this);\r
+       }\r
+       protected void createFormContent(final IManagedForm managedForm) {\r
+               final ScrolledForm form = managedForm.getForm();\r
+               //FormToolkit toolkit = managedForm.getToolkit();\r
+               form.setText(Messages.getString("MasterDetailsPage.title")); //$NON-NLS-1$\r
+               form.setBackgroundImage(Activator.getDefault().getImage(\r
+                               Activator.IMG_FORM_BG));\r
+               block.createContent(managedForm);\r
+       }\r
+}
\ No newline at end of file
index f662e06..54245b8 100644 (file)
@@ -16,7 +16,7 @@ public class MessagePopupAction extends Action {
         setId(ICommandIds.CMD_OPEN_MESSAGE);
         // Associate the action with a pre-defined command, to allow key bindings.
         setActionDefinitionId(ICommandIds.CMD_OPEN_MESSAGE);
-        setImageDescriptor(eu.etaxonomy.taxeditor.Activator.getImageDescriptor("/icons/sample3.gif"));
+        setImageDescriptor(Activator.getImageDescriptorOrig("/icons/sample3.gif"));
     }
 
     public void run() {
diff --git a/src/eu/etaxonomy/taxeditor/Messages.java b/src/eu/etaxonomy/taxeditor/Messages.java
new file mode 100644 (file)
index 0000000..4cf03cd
--- /dev/null
@@ -0,0 +1,23 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import java.util.MissingResourceException;\r
+import java.util.ResourceBundle;\r
+\r
+public class Messages {\r
+       private static final String BUNDLE_NAME = "eu.etaxonomy.taxeditor.messages"; //$NON-NLS-1$\r
+\r
+       private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle\r
+                       .getBundle(BUNDLE_NAME);\r
+\r
+       private Messages() {\r
+       }\r
+\r
+       public static String getString(String key) {\r
+               // TODO Auto-generated method stub\r
+               try {\r
+                       return RESOURCE_BUNDLE.getString(key);\r
+               } catch (MissingResourceException e) {\r
+                       return '!' + key + '!';\r
+               }\r
+       }\r
+}
\ No newline at end of file
diff --git a/src/eu/etaxonomy/taxeditor/Name.java b/src/eu/etaxonomy/taxeditor/Name.java
new file mode 100644 (file)
index 0000000..2ef1f54
--- /dev/null
@@ -0,0 +1,64 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+public class Name extends NamedObject {\r
+       public static final String P_CHOICE="choice"; //$NON-NLS-1$\r
+       public static final String P_FLAG="flag"; //$NON-NLS-1$\r
+       public static final String P_TEXT="text"; //$NON-NLS-1$\r
+       public static final String P_GENUSNAME="genusname"; //$NON-NLS-1$\r
+       public static final String P_SPECIESEPITHET="speciesepithet"; //$NON-NLS-1$\r
+       public static final String [] CHOICES = {\r
+                       Messages.getString("TypeOne.c1"), Messages.getString("TypeOne.c2"), Messages.getString("TypeOne.c3"), Messages.getString("TypeOne.c4") }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$\r
+       private int choice=0;\r
+       private String text;\r
+       private String genusName;\r
+       private String speciesEpithet;\r
+       private boolean flag;\r
+\r
+       /**\r
+        * @param name\r
+        */\r
+       public Name(String name, String genusName, String speciesEpithet) {\r
+               super(name);\r
+               this.genusName = genusName;\r
+               this.speciesEpithet = speciesEpithet;\r
+               this.text = name;\r
+               \r
+               this.flag = true;\r
+               this.choice = 2;\r
+       }\r
+       public int getChoice() {\r
+               return choice;\r
+       }\r
+       public void setChoice(int choice) {\r
+               this.choice = choice;\r
+               model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_CHOICE);\r
+       }\r
+       public boolean getFlag() {\r
+               return flag;\r
+       }\r
+       public void setFlag(boolean flag) {\r
+               this.flag = flag;\r
+               model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_FLAG);\r
+       }\r
+       public String getText() {\r
+               return text;\r
+       }\r
+       public void setText(String text) {\r
+               this.text = text;\r
+               model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_TEXT);\r
+       }\r
+       public String getGenusName() {\r
+               return genusName;\r
+       }\r
+       public void setGenusName(String genusName) {\r
+               this.genusName = genusName;\r
+               model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_GENUSNAME);\r
+       }\r
+       public String getSpeciesEpithet() {\r
+               return speciesEpithet;\r
+       }\r
+       public void setSpeciesEpithet(String speciesEpithet) {\r
+               this.speciesEpithet = speciesEpithet;\r
+               model.fireModelChanged(new Object[] {this}, IModelListener.CHANGED, P_SPECIESEPITHET);\r
+       }\r
+}\r
diff --git a/src/eu/etaxonomy/taxeditor/NameDetailsPage.java b/src/eu/etaxonomy/taxeditor/NameDetailsPage.java
new file mode 100644 (file)
index 0000000..222a7e3
--- /dev/null
@@ -0,0 +1,215 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.jface.viewers.IStructuredSelection;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.events.ModifyEvent;\r
+import org.eclipse.swt.events.ModifyListener;\r
+import org.eclipse.swt.layout.GridData;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Button;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.eclipse.swt.widgets.Text;\r
+import org.eclipse.ui.forms.IDetailsPage;\r
+import org.eclipse.ui.forms.IFormPart;\r
+import org.eclipse.ui.forms.IManagedForm;\r
+import org.eclipse.ui.forms.widgets.FormToolkit;\r
+import org.eclipse.ui.forms.widgets.Section;\r
+import org.eclipse.ui.forms.widgets.TableWrapData;\r
+import org.eclipse.ui.forms.widgets.TableWrapLayout;\r
+\r
+public class NameDetailsPage implements IDetailsPage {\r
+       private IManagedForm mform;\r
+       private Name input;\r
+       //private TaxonName input;\r
+       private Button [] choices;\r
+       private Button flag;\r
+       private Text text;\r
+       private Text genusName;\r
+       private Text speciesEpithet;\r
+       private Section s1;\r
+       private static final String RTEXT_DATA =\r
+                       "<form><p>An example of a free-form text that should be "+ //$NON-NLS-1$\r
+                       "wrapped below the section with widgets.</p>"+ //$NON-NLS-1$\r
+                       "<p>It can contain simple tags like <a>links</a> and <b>bold text</b>.</p></form>"; //$NON-NLS-1$\r
+       \r
+       public NameDetailsPage() {\r
+       }\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.IDetailsPage#initialize(org.eclipse.ui.forms.IManagedForm)\r
+        */\r
+       public void initialize(IManagedForm mform) {\r
+               this.mform = mform;\r
+       }\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite)\r
+        */\r
+       public void createContents(Composite parent) {\r
+               TableWrapLayout layout = new TableWrapLayout();\r
+               layout.topMargin = 5;\r
+               layout.leftMargin = 5;\r
+               layout.rightMargin = 2;\r
+               layout.bottomMargin = 2;\r
+               parent.setLayout(layout);\r
+               \r
+               FormToolkit toolkit = mform.getToolkit();\r
+               //s1 = toolkit.createSection(parent, Section.DESCRIPTION|Section.TITLE_BAR);\r
+               s1 = toolkit.createSection(parent, Section.TITLE_BAR);\r
+               s1.marginWidth = 10;\r
+               s1.setText("Type One Details"); //$NON-NLS-1$\r
+               //s1.setDescription(Messages.getString("TypeOneDetailsPage.name")); //$NON-NLS-1$\r
+               TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);\r
+               td.grabHorizontal = true;\r
+               s1.setLayoutData(td);\r
+               Composite client = toolkit.createComposite(s1);\r
+               GridLayout glayout = new GridLayout();\r
+               glayout.marginWidth = glayout.marginHeight = 0;\r
+               glayout.numColumns = 2;\r
+               client.setLayout(glayout);\r
+               GridData gd;\r
+               \r
+               /*SelectionListener choiceListener = new SelectionAdapter() {\r
+                       public void widgetSelected(SelectionEvent e) {\r
+                               Integer value = (Integer)e.widget.getData();\r
+                               if (input!=null) {\r
+                                       input.setChoice(value.intValue());\r
+                               }\r
+                       }\r
+               };      */\r
+                                       \r
+               /*\r
+               NOTE: this can only be commented out when CHOICES part of update() below is also commented out \r
+               choices = new Button[TypeOne.CHOICES.length];\r
+               for (int i=0; i<Name.CHOICES.length; i++) {\r
+                       choices[i] = toolkit.createButton(client, Name.CHOICES[i], SWT.RADIO);\r
+                       choices[i].setData(new Integer(i));\r
+                       //choices[i].addSelectionListener(choiceListener);\r
+                       gd = new GridData();\r
+                       gd.horizontalSpan = 2;\r
+                       choices[i].setLayoutData(gd);\r
+               }*/\r
+               /*createSpacer(toolkit, client, 2);\r
+               flag = toolkit.createButton(client, Messages.getString("TypeOneDetailsPage.check"), SWT.CHECK); //$NON-NLS-1$\r
+               flag.addSelectionListener(new SelectionAdapter() {\r
+                       public void widgetSelected(SelectionEvent e) {\r
+                               if (input!=null)\r
+                                       input.setFlag(flag.getSelection());\r
+                       }\r
+               });\r
+               gd = new GridData();\r
+               gd.horizontalSpan = 2;\r
+               flag.setLayoutData(gd);*/\r
+               createSpacer(toolkit, client, 2);\r
+               \r
+               /*toolkit.createLabel(client, "Scientific Name:"); //$NON-NLS-1$\r
+               text = toolkit.createText(client, "", SWT.SINGLE); //$NON-NLS-1$\r
+               text.addModifyListener(new ModifyListener() {\r
+                       public void modifyText(ModifyEvent e) {\r
+                               if (input!=null)\r
+                                       input.setText(text.getText());\r
+                       }\r
+               });*/\r
+               \r
+               toolkit.createLabel(client, "Genus Name:"); //$NON-NLS-1$\r
+               genusName = toolkit.createText(client, "", SWT.BORDER | SWT.SHADOW_NONE); //$NON-NLS-1$\r
+               genusName.addModifyListener(new ModifyListener() {\r
+                       public void modifyText(ModifyEvent e) {\r
+                               if (input!=null)\r
+                                       input.setGenusName(genusName.getText());\r
+                                       //input.setGenus(genusName.getText());\r
+                       }\r
+               });\r
+               \r
+               toolkit.createLabel(client, "Species Epithet:"); //$NON-NLS-1$\r
+               speciesEpithet = toolkit.createText(client, "", SWT.BORDER); //$NON-NLS-1$\r
+               speciesEpithet.addModifyListener(new ModifyListener() {\r
+                       public void modifyText(ModifyEvent e) {\r
+                               if (input!=null)\r
+                                       input.setSpeciesEpithet(speciesEpithet.getText());\r
+                                       //input.setSpecificEpithet(speciesEpithet.getText());\r
+                       }\r
+               });\r
+               \r
+               gd = new GridData(GridData.FILL_HORIZONTAL|GridData.VERTICAL_ALIGN_BEGINNING);\r
+               gd.widthHint = 10;\r
+               /*text.setLayoutData(gd);*/\r
+               genusName.setLayoutData(gd);\r
+               speciesEpithet.setLayoutData(gd);\r
+               \r
+               createSpacer(toolkit, client, 2);\r
+               /*\r
+               FormText rtext = toolkit.createFormText(parent, true);\r
+               rtext.setText(RTEXT_DATA, true, false);\r
+               td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);\r
+               td.grabHorizontal = true;\r
+               rtext.setLayoutData(td);\r
+               */\r
+               toolkit.paintBordersFor(s1);\r
+               s1.setClient(client);\r
+       }\r
+       private void createSpacer(FormToolkit toolkit, Composite parent, int span) {\r
+               Label spacer = toolkit.createLabel(parent, ""); //$NON-NLS-1$\r
+               GridData gd = new GridData();\r
+               gd.horizontalSpan = span;\r
+               spacer.setLayoutData(gd);\r
+       }\r
+       private void update() {\r
+               /*for (int i=0; i<TypeOne.CHOICES.length; i++) {\r
+                       choices[i].setSelection(input!=null && input.getChoice()==i);\r
+               }*/\r
+               /*flag.setSelection(input!=null && input.getFlag());*/\r
+               //s1.setText(input!=null && input.getFullName() !=null?input.getFullName():"");\r
+               s1.setText(input!=null && input.getText() !=null?input.getText():"");\r
+               /*text.setText(input!=null && input.getText()!=null?input.getText():"");*/\r
+               genusName.setText(input!=null && input.getGenusName()!=null?input.getGenusName():"");\r
+               speciesEpithet.setText(input!=null && input.getSpeciesEpithet()!=null?input.getSpeciesEpithet():"");\r
+       }\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.IDetailsPage#inputChanged(org.eclipse.jface.viewers.IStructuredSelection)\r
+        */\r
+       public void selectionChanged(IFormPart part, ISelection selection) {\r
+               IStructuredSelection ssel = (IStructuredSelection)selection;\r
+               if (ssel.size()==1) {\r
+                       input = (Name)ssel.getFirstElement();\r
+                       //input = (TaxonName)ssel.getFirstElement();\r
+               }\r
+               else\r
+                       input = null;\r
+               update();\r
+       }\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.IDetailsPage#commit()\r
+        */\r
+       public void commit(boolean onSave) {\r
+       }\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.IDetailsPage#setFocus()\r
+        */\r
+       public void setFocus() {\r
+               choices[0].setFocus();\r
+       }\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.IDetailsPage#dispose()\r
+        */\r
+       public void dispose() {\r
+       }\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.IDetailsPage#isDirty()\r
+        */\r
+       public boolean isDirty() {\r
+               return false;\r
+       }\r
+       public boolean isStale() {\r
+               return false;\r
+       }\r
+       /* (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.IDetailsPage#refresh()\r
+        */\r
+       public void refresh() {\r
+               update();\r
+       }\r
+       public boolean setFormInput(Object input) {\r
+               return false;\r
+       }\r
+}\r
diff --git a/src/eu/etaxonomy/taxeditor/NamedObject.java b/src/eu/etaxonomy/taxeditor/NamedObject.java
new file mode 100644 (file)
index 0000000..b5e5cac
--- /dev/null
@@ -0,0 +1,23 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+public class NamedObject {\r
+       private String name;\r
+       protected SimpleModel model;\r
+       \r
+       public NamedObject(String name) {\r
+               this.name = name;\r
+       }\r
+       public void setModel(SimpleModel model) {\r
+               this.model = model;\r
+       }\r
+       public String getName() {\r
+               return name;\r
+       }\r
+       public String toString() {\r
+               return getName();\r
+       }\r
+       public void setName(String name) {\r
+               this.name = name;\r
+               model.fireModelChanged(new Object [] {this}, IModelListener.CHANGED, ""); //$NON-NLS-1$\r
+       }\r
+}\r
diff --git a/src/eu/etaxonomy/taxeditor/OpenFormEditorAction.java b/src/eu/etaxonomy/taxeditor/OpenFormEditorAction.java
new file mode 100644 (file)
index 0000000..4e482f4
--- /dev/null
@@ -0,0 +1,53 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import org.eclipse.jface.action.IAction;\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.ui.IEditorInput;\r
+import org.eclipse.ui.IWorkbenchPage;\r
+import org.eclipse.ui.IWorkbenchWindow;\r
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;\r
+import org.eclipse.ui.PartInitException;\r
+\r
+/**\r
+ * @see IWorkbenchWindowActionDelegate\r
+ */\r
+public abstract class OpenFormEditorAction\r
+               implements\r
+                       IWorkbenchWindowActionDelegate {\r
+       private IWorkbenchWindow window;\r
+/*\r
+ * \r
+ */\r
+       protected void openEditor(String inputName, String editorId) {\r
+               openEditor(new FormEditorInput(inputName), editorId);\r
+       }\r
+       protected void openEditor(IEditorInput input, String editorId) {\r
+               IWorkbenchPage page = window.getActivePage();\r
+               try {\r
+                       page.openEditor(input, editorId);\r
+               } catch (PartInitException e) {\r
+                       System.out.println(e);\r
+               }\r
+       }\r
+       \r
+       protected IWorkbenchWindow getWindow() {\r
+               return window;\r
+       }\r
+       /**\r
+        * @see IWorkbenchWindowActionDelegate#selectionChanged\r
+        */\r
+       public void selectionChanged(IAction action, ISelection selection) {\r
+       }\r
+       /**\r
+        * @see IWorkbenchWindowActionDelegate#dispose\r
+        */\r
+       public void dispose() {\r
+       }\r
+       /**\r
+        * @see IWorkbenchWindowActionDelegate#init\r
+        */\r
+       public void init(IWorkbenchWindow window) {\r
+               this.window = window;\r
+       }\r
+}\r
+\r
diff --git a/src/eu/etaxonomy/taxeditor/OpenSimpleFormEditorAction.java b/src/eu/etaxonomy/taxeditor/OpenSimpleFormEditorAction.java
new file mode 100644 (file)
index 0000000..9141b29
--- /dev/null
@@ -0,0 +1,12 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import org.eclipse.jface.action.IAction;\r
+\r
+/**\r
+ * @see IWorkbenchWindowActionDelegate\r
+ */\r
+public class OpenSimpleFormEditorAction extends OpenFormEditorAction {\r
+       public void run(IAction action) {\r
+               openEditor(new SimpleFormEditorInput(Messages.getString("OpenSimpleFormEditorAction.name")), "eu.etaxonomy.taxeditor.base-editor"); //$NON-NLS-1$ //$NON-NLS-2$\r
+       }\r
+}\r
index 3c617db..6c985cf 100644 (file)
@@ -6,7 +6,6 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PartInitException;
 
-
 public class OpenViewAction extends Action {
        
        private final IWorkbenchWindow window;
@@ -14,17 +13,19 @@ public class OpenViewAction extends Action {
        private final String viewId;
        
        public OpenViewAction(IWorkbenchWindow window, String label, String viewId) {
+               
                this.window = window;
                this.viewId = viewId;
-        setText(label);
+        setText(label); //Open Another Message View
         // The id is used to refer to the action in a menu or toolbar
                setId(ICommandIds.CMD_OPEN);
         // Associate the action with a pre-defined command, to allow key bindings.
                setActionDefinitionId(ICommandIds.CMD_OPEN);
-               setImageDescriptor(eu.etaxonomy.taxeditor.Activator.getImageDescriptor("/icons/sample2.gif"));
+               setImageDescriptor(Activator.getImageDescriptorOrig("/icons/sample2.gif"));
        }
        
        public void run() {
+               
                if(window != null) {    
                        try {
                                window.getActivePage().showView(viewId, Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
index d99ea36..77ba8e8 100644 (file)
@@ -8,13 +8,20 @@ public class Perspective implements IPerspectiveFactory {
 
        public void createInitialLayout(IPageLayout layout) {
                String editorArea = layout.getEditorArea();
-               layout.setEditorAreaVisible(false);
+               //layout.setEditorAreaVisible(false);
+               layout.setEditorAreaVisible(true);
                
                layout.addStandaloneView(NavigationView.ID,  false, IPageLayout.LEFT, 0.25f, editorArea);
                IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP, 0.5f, editorArea);
                folder.addPlaceholder(View.ID + ":*");
                folder.addView(View.ID);
+               folder.addPlaceholder(FormView.ID + ":*");
+               folder.addView(FormView.ID);
                
+               //layout.addStandaloneView(View.ID, false, IPageLayout.RIGHT, 0.75f, editorArea);
+
                layout.getViewLayout(NavigationView.ID).setCloseable(false);
+                               
+               layout.addActionSet("eu.etaxonomy.taxeditor.actionSet");
        }
 }
diff --git a/src/eu/etaxonomy/taxeditor/ScrolledPropertiesBlock.java b/src/eu/etaxonomy/taxeditor/ScrolledPropertiesBlock.java
new file mode 100644 (file)
index 0000000..e488517
--- /dev/null
@@ -0,0 +1,139 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import org.eclipse.jface.action.Action;\r
+import org.eclipse.jface.viewers.ISelectionChangedListener;\r
+import org.eclipse.jface.viewers.IStructuredContentProvider;\r
+import org.eclipse.jface.viewers.ITableLabelProvider;\r
+import org.eclipse.jface.viewers.LabelProvider;\r
+import org.eclipse.jface.viewers.SelectionChangedEvent;\r
+import org.eclipse.jface.viewers.TableViewer;\r
+import org.eclipse.jface.viewers.Viewer;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.graphics.Image;\r
+import org.eclipse.swt.layout.GridData;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Button;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Table;\r
+import org.eclipse.ui.ISharedImages;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.eclipse.ui.forms.DetailsPart;\r
+import org.eclipse.ui.forms.IManagedForm;\r
+import org.eclipse.ui.forms.MasterDetailsBlock;\r
+import org.eclipse.ui.forms.SectionPart;\r
+import org.eclipse.ui.forms.editor.FormPage;\r
+import org.eclipse.ui.forms.widgets.FormToolkit;\r
+import org.eclipse.ui.forms.widgets.ScrolledForm;\r
+import org.eclipse.ui.forms.widgets.Section;\r
+\r
+public class ScrolledPropertiesBlock extends MasterDetailsBlock {\r
+       private FormPage page;\r
+       public ScrolledPropertiesBlock(FormPage page) {\r
+               this.page = page;\r
+       }\r
+       /**\r
+        * @param id\r
+        * @param title\r
+        */\r
+       class MasterContentProvider implements IStructuredContentProvider {\r
+               public Object[] getElements(Object inputElement) {\r
+                       if (inputElement instanceof SimpleFormEditorInput) {\r
+                               SimpleFormEditorInput input = (SimpleFormEditorInput) page\r
+                                               .getEditor().getEditorInput();\r
+                               return input.getModel().getContents();\r
+                       }\r
+                       return new Object[0];\r
+               }\r
+               public void dispose() {\r
+               }\r
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {\r
+               }\r
+       }\r
+       class MasterLabelProvider extends LabelProvider\r
+                       implements\r
+                               ITableLabelProvider {\r
+               public String getColumnText(Object obj, int index) {\r
+                       return obj.toString();\r
+               }\r
+               public Image getColumnImage(Object obj, int index) {\r
+                       /*if (obj instanceof TypeOne) {\r
+                               return PlatformUI.getWorkbench().getSharedImages().getImage(\r
+                                               ISharedImages.IMG_OBJ_ELEMENT);\r
+                       }\r
+                       if (obj instanceof TypeTwo) {\r
+                               return PlatformUI.getWorkbench().getSharedImages().getImage(\r
+                                               ISharedImages.IMG_OBJ_FILE);\r
+                       }\r
+                       return null;\r
+                       */\r
+                       return null;\r
+               }\r
+       }\r
+       protected void createMasterPart(final IManagedForm managedForm,\r
+                       Composite parent) {\r
+               //final ScrolledForm form = managedForm.getForm();\r
+               FormToolkit toolkit = managedForm.getToolkit();\r
+               Section section = toolkit.createSection(parent, Section.DESCRIPTION|Section.TITLE_BAR);\r
+               section.setText(Messages.getString("ScrolledPropertiesBlock.sname")); //$NON-NLS-1$\r
+               section\r
+                               .setDescription(Messages.getString("ScrolledPropertiesBlock.sdesc")); //$NON-NLS-1$\r
+               section.marginWidth = 10;\r
+               section.marginHeight = 5;\r
+               Composite client = toolkit.createComposite(section, SWT.WRAP);\r
+               GridLayout layout = new GridLayout();\r
+               layout.numColumns = 2;\r
+               layout.marginWidth = 2;\r
+               layout.marginHeight = 2;\r
+               client.setLayout(layout);\r
+               Table t = toolkit.createTable(client, SWT.NULL);\r
+               GridData gd = new GridData(GridData.FILL_BOTH);\r
+               gd.heightHint = 20;\r
+               gd.widthHint = 100;\r
+               t.setLayoutData(gd);\r
+               toolkit.paintBordersFor(client);\r
+               Button b = toolkit.createButton(client, Messages.getString("ScrolledPropertiesBlock.add"), SWT.PUSH); //$NON-NLS-1$\r
+               gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);\r
+               b.setLayoutData(gd);\r
+               section.setClient(client);\r
+               final SectionPart spart = new SectionPart(section);\r
+               managedForm.addPart(spart);\r
+               TableViewer viewer = new TableViewer(t);\r
+               viewer.addSelectionChangedListener(new ISelectionChangedListener() {\r
+                       public void selectionChanged(SelectionChangedEvent event) {\r
+                               managedForm.fireSelectionChanged(spart, event.getSelection());\r
+                       }\r
+               });\r
+               viewer.setContentProvider(new MasterContentProvider());\r
+               viewer.setLabelProvider(new MasterLabelProvider());\r
+               viewer.setInput(page.getEditor().getEditorInput());\r
+       }\r
+       protected void createToolBarActions(IManagedForm managedForm) {\r
+               final ScrolledForm form = managedForm.getForm();\r
+               Action haction = new Action("hor", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$\r
+                       public void run() {\r
+                               sashForm.setOrientation(SWT.HORIZONTAL);\r
+                               form.reflow(true);\r
+                       }\r
+               };\r
+               haction.setChecked(true);\r
+               haction.setToolTipText(Messages.getString("ScrolledPropertiesBlock.horizontal")); //$NON-NLS-1$\r
+               haction.setImageDescriptor(Activator.getDefault()\r
+                               .getImageRegistry()\r
+                               .getDescriptor(Activator.IMG_HORIZONTAL));\r
+               Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$\r
+                       public void run() {\r
+                               sashForm.setOrientation(SWT.VERTICAL);\r
+                               form.reflow(true);\r
+                       }\r
+               };\r
+               vaction.setChecked(false);\r
+               vaction.setToolTipText(Messages.getString("ScrolledPropertiesBlock.vertical")); //$NON-NLS-1$\r
+               vaction.setImageDescriptor(Activator.getDefault()\r
+                               .getImageRegistry().getDescriptor(Activator.IMG_VERTICAL));\r
+               form.getToolBarManager().add(haction);\r
+               form.getToolBarManager().add(vaction);\r
+       }\r
+       protected void registerPages(DetailsPart detailsPart) {\r
+               detailsPart.registerPage(Name.class, new NameDetailsPage());\r
+       }\r
+}
\ No newline at end of file
diff --git a/src/eu/etaxonomy/taxeditor/SimpleFormEditor.java b/src/eu/etaxonomy/taxeditor/SimpleFormEditor.java
new file mode 100644 (file)
index 0000000..38c911e
--- /dev/null
@@ -0,0 +1,72 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.swt.widgets.Display;\r
+import org.eclipse.ui.PartInitException;\r
+import org.eclipse.ui.forms.editor.FormEditor;\r
+import org.eclipse.ui.forms.widgets.FormToolkit;\r
+\r
+/**\r
+ * A simple multi-page form editor that uses Eclipse Forms support.\r
+ * Example plug-in is configured to create one instance of\r
+ * form colors that is shared between multiple editor instances.\r
+ */\r
+public class SimpleFormEditor extends FormEditor {\r
+       /**\r
+        *  \r
+        */\r
+       //public static final String ID = "eu.etaxonomy.taxeditor.base-editor";\r
+       \r
+       public SimpleFormEditor() {\r
+       }\r
+       /*\r
+        *  (non-Javadoc)\r
+        * @see org.eclipse.ui.forms.editor.FormEditor#createToolkit(org.eclipse.swt.widgets.Display)\r
+        */\r
+       protected FormToolkit createToolkit(Display display) {\r
+               // Create a toolkit that shares colors between editors.\r
+               return new FormToolkit(Activator.getDefault().getFormColors(\r
+                               display));\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.forms.editor.FormEditor#addPages()\r
+        */\r
+       protected void addPages() {\r
+               try {\r
+               /*addPage(new FreeFormPage(this));\r
+               addPage(new SecondPage(this));\r
+               int index = addPage(new Composite(getContainer(), SWT.NULL));\r
+               setPageText(index, "Composite"); //$NON-NLS-1$\r
+               addPage(new ThirdPage(this));*/\r
+               addPage(new MasterDetailsPage(this));\r
+               /*addPage(new PageWithSubPages(this));*/\r
+               }\r
+               catch (PartInitException e) {\r
+                       //\r
+               }\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)\r
+        */\r
+       public void doSave(IProgressMonitor monitor) {\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.ISaveablePart#doSaveAs()\r
+        */\r
+       public void doSaveAs() {\r
+       }\r
+       /*\r
+        * (non-Javadoc)\r
+        * \r
+        * @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()\r
+        */\r
+       public boolean isSaveAsAllowed() {\r
+               return false;\r
+       }\r
+}
\ No newline at end of file
diff --git a/src/eu/etaxonomy/taxeditor/SimpleFormEditorInput.java b/src/eu/etaxonomy/taxeditor/SimpleFormEditorInput.java
new file mode 100644 (file)
index 0000000..c251728
--- /dev/null
@@ -0,0 +1,14 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+public class SimpleFormEditorInput extends FormEditorInput {\r
+       private SimpleModel model;\r
+       \r
+       public SimpleFormEditorInput(String name) {\r
+               super(name);\r
+               model = new SimpleModel();\r
+       }\r
+       \r
+       public SimpleModel getModel() {\r
+               return model;\r
+       }\r
+}
\ No newline at end of file
diff --git a/src/eu/etaxonomy/taxeditor/SimpleModel.java b/src/eu/etaxonomy/taxeditor/SimpleModel.java
new file mode 100644 (file)
index 0000000..e7f1b49
--- /dev/null
@@ -0,0 +1,78 @@
+package eu.etaxonomy.taxeditor;\r
+\r
+import java.util.ArrayList;\r
+\r
+//import eu.etaxonomy.cdm.model.name.TaxonName;\r
+\r
+public class SimpleModel {\r
+       private ArrayList modelListeners;\r
+       private ArrayList objects;\r
+       public SimpleModel() {\r
+               modelListeners = new ArrayList();\r
+               initialize();\r
+       }\r
+       public void addModelListener(IModelListener listener) {\r
+               if (!modelListeners.contains(listener))\r
+                       modelListeners.add(listener);\r
+       }\r
+       public void removeModelListener(IModelListener listener) {\r
+               modelListeners.remove(listener);\r
+       }\r
+       public void fireModelChanged(Object[] objects, String type, String property) {\r
+               for (int i = 0; i < modelListeners.size(); i++) {\r
+                       ((IModelListener) modelListeners.get(i)).modelChanged(objects,\r
+                                       type, property);\r
+               }\r
+       }\r
+       public Object[] getContents() {\r
+               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
+       }\r
+       public void add(NamedObject[] objs, boolean notify) {\r
+               for (int i = 0; i < objs.length; i++) {\r
+                       objects.add(objs[i]);\r
+                       objs[i].setModel(this);\r
+               }\r
+               if (notify)\r
+                       fireModelChanged(objs, IModelListener.ADDED, ""); //$NON-NLS-1$\r
+       }\r
+       \r
+//     public void add(ArrayList<TaxonName> tns, boolean notify) {\r
+//             for (int i = 0; i < tns.size(); i++) {\r
+//                     objects.add(tns.get(i));\r
+//                     //tns[i].setModel(this);\r
+//             }\r
+//             //if (notify)\r
+//                     //fireModelChanged(tns, IModelListener.ADDED, ""); //$NON-NLS-1$\r
+//     }\r
+               \r
+       public void remove(NamedObject[] objs, boolean notify) {\r
+               for (int i = 0; i < objs.length; i++) {\r
+                       objects.remove(objs[i]);\r
+                       objs[i].setModel(null);\r
+               }\r
+               if (notify)\r
+                       fireModelChanged(objs, IModelListener.REMOVED, ""); //$NON-NLS-1$\r
+       }\r
+}\r
index 20d0527..2b798c0 100644 (file)
@@ -21,8 +21,8 @@ public class View extends ViewPart {
        public void createPartControl(Composite parent) {
                Composite top = new Composite(parent, SWT.NONE);
                GridLayout layout = new GridLayout();
-               layout.marginHeight = 0;
-               layout.marginWidth = 0;
+               layout.marginHeight = 10;
+               layout.marginWidth = 10;
                top.setLayout(layout);
                // top banner
                Composite banner = new Composite(top, SWT.NONE);
diff --git a/src/eu/etaxonomy/taxeditor/messages.properties b/src/eu/etaxonomy/taxeditor/messages.properties
new file mode 100644 (file)
index 0000000..af10879
--- /dev/null
@@ -0,0 +1,125 @@
+FormView.title=Hello, Eclipse Forms\r
+FormView.link=Click here.\r
+FormView.linkMessage=Link activated\!\r
+FormView.longLink=This is an example of a form that is much longer and will need to wrap.\r
+FormView.textLabel=Text field label:\r
+FormView.checkbox=A checkbox in a form\r
+FormView.expandable=Expandable Composite title\r
+FormView.expandableText=We will now create a somewhat long text so that \r
+FormView.expandablText2=we can use it as content for the expandable composite. \r
+FormView.expandableText3=Expandable composite is used to hide or show the text using the \r
+FormView.expandableText4=toggle control\r
+FormView.stitle=Section title\r
+FormView.sdesc=This is the description that goes below the title\r
+FormView.radio1=Radio 1\r
+FormView.radio2=Radio 2\r
+FormView.ftext1=Here is some plain text for the text to render; \r
+FormView.ftext2=this text is at <a href="http://www.eclipse.org" nowrap="true">http://www.eclipse.org</a> web site.\r
+FormView.ftext3=<span color="header" font="header">This text is in header font and color.</span>\r
+FormView.ftext4=<p>This line will contain some <b>bold</b> and some <span font="code">source</span> text. \r
+FormView.ftext5=We can also add <img href="image"/> an image. \r
+FormView.ftext6=<li>A default (bulleted) list item.</li>\r
+FormView.ftext7=<li>Another bullet list item.</li>\r
+FormView.ftext8=<li style="text" value="1.">A list item with text.</li>\r
+FormView.ftext9=<li style="text" value="2.">Another list item with text</li>\r
+FormView.ftext10=<li style="image" value="image">List item with an image bullet</li>\r
+FormView.ftext11=<li style="text" bindent="20" indent="40" value="3.">A list item with text.</li>\r
+FormView.ftext12=<li style="text" bindent="20" indent="40" value="4.">A list item with text.</li>\r
+FormView.ftext13=<p>     leading blanks;      more white \n\n new lines   <br/>  \n   more <b>   bb   </b>  white  . </p>\r
+FormView.lmessage=Link active: \r
+FreeFormPage.label=First Page\r
+FreeFormPage.title=Free-form text with links\r
+FreeFormPage.link=Sample hyperlink with longer text.\r
+FreeFormPage.button=Button\r
+FreeFormPage.sectionTitle1=Expandable Section with a longer title\r
+FreeFormPage.sectionTitle2=Section title\r
+FreeFormPage.sectionDescription=This is a section description that should be rendered below the separator.\r
+FreeFormPage.mtitle=Eclipse Forms\r
+FreeFormPage.mtext=Link activated: href=\r
+SecondPage.label=Section Page\r
+SecondPage.title=Title for the second page\r
+SecondPage.firstSection=First Table Section\r
+SecondPage.secondSection=Second Table Section\r
+SecondPage.add=Add...\r
+SecondPage.desc=This section has a tree and a button.\r
+ScrolledPropertiesBlock.sname=Names\r
+ScrolledPropertiesBlock.sdesc=Click on a name to edit its fields in the detail view.\r
+ScrolledPropertiesBlock.add=Add...\r
+ScrolledPropertiesBlock.horizontal=Horizontal orientation\r
+ScrolledPropertiesBlock.vertical=Vertical orientation\r
+TypeOneDetailsPage.name=Set the properties of the selected TypeOne object.\r
+TypeTwoDetailsPage.name=Type Two Details\r
+TypeTwoDetailsPage.desc=Set the properties of the selected TypeTwo object.\r
+TypeOneDetailsPage.check=Value of the flag property\r
+TypeOneDetailsPage.label=Text property:\r
+TypeTwoDetailsPage.flag1=Value of the flag1 property\r
+TypeTwoDetailsPage.flag2=Value of the flag2 property\r
+OpenSimpleFormEditorAction.name=Simple Editor\r
+SimpleModel.t1_i1=TypeOne instance 1\r
+SimpleModel.text1=Some text\r
+SimpleModel.t1_i2=TypeOne instance 2\r
+SimpleModel.text2=Different text\r
+SimpleModel.t1_i3=TypeOne instance 3\r
+SimpleModel.text3=Text\r
+SimpleModel.t1_i4=TypeOne instance 4\r
+SimpleModel.text4=Longer text\r
+SimpleModel.t1_i5=TypeOne instance 5\r
+SimpleModel.text5=Sample\r
+SimpleModel.t2_i1=TypeTwo instance 1\r
+SimpleModel.t2_i2=TypeTwo instance 2\r
+MasterDetailsPage.label=Master Details\r
+MasterDetailsPage.title=Edit Name Demo\r
+ThirdPage.label=Flow Page\r
+ThirdPage.title=Form with wrapped controls\r
+ThirdPage.ls1.name=Link Section\r
+ThirdPage.ls1.desc=An example of a section with links\r
+ThirdPage.ls2.name=Link Section\r
+ThirdPage.ls2.desc=An example of a section with links\r
+ThirdPage.ms1.name=Mixed Section\r
+ThirdPage.ms1.desc=An example of a section with both links and form controls\r
+ThirdPage.ls3.name=Link Section\r
+ThirdPage.ls3.desc=An example of a section with links\r
+ThirdPage.cs1.name=Control Section\r
+ThirdPage.cs1.desc=An example of a section with form controls\r
+ThirdPage.ls4.name=Sample Section\r
+ThirdPage.ls4.desc=An example of a section with links\r
+ThirdPage.ls5.name=Sample Section\r
+ThirdPage.ls5.desc=An example of a section with links\r
+ThirdPage.ms2.name=Mixed Section\r
+ThirdPage.ms2.desc=An example of a section with both links and form controls\r
+ThirdPage.l6.name=Sample Section\r
+ThirdPage.l6.desc=An example of a section with links\r
+ThirdPage.cs2.name=Control Section\r
+ThirdPage.cs2.desc=An example of a section with links\r
+ThirdPage.l7.name=Sample Section\r
+ThirdPage.l7.desc=An example of a section with links\r
+ThirdPage.l8.name=Sample Section\r
+ThirdPage.l8.desc=An example of a section with links\r
+ThirdPage.m3.name=Mixed Section\r
+ThirdPage.m3.desc=An example of a section with both links and form controls\r
+ThirdPage.l9.name=Sample Section\r
+ThirdPage.l9.desc=An example of a section with links\r
+ThirdPage.c3.name=Control Section\r
+ThirdPage.c3.desc=An example of a section with form controls\r
+ThirdPage.link=Hyperlink text \r
+ThirdPage.button1=A radio button 1\r
+ThirdPage.button2=A radio button 2\r
+ThirdPage.button3=A radio button with a longer text\r
+ThirdPage.checkbox=A checkbox button\r
+ThirdPage.longlink=A longer hyperlink text example\r
+ThirdPage.link2=Another hyperlink text\r
+ThirdPage.textLabel=A text label:\r
+PageWithSubPages.label=Composite Page\r
+PageWithSubPages.title=Form with subpages\r
+PageWithSubPages.copyright.tab=Copyright\r
+PageWithSubPages.copyright.text=Copyright 2004 IBM and others.\r
+PageWithSubPages.license.tab=License Agreement\r
+PageWithSubPages.license.text=LICENSE AGREEMENT\n\nUse this feature any way you want.\r
+PageWithSubPages.desc.tab=Description\r
+PageWithSubPages.desc.text=A simple description of the feature\r
+PageWithSubPages.apply=Apply\r
+PageWithSubPages.reset=Reset\r
+TypeOne.c1=Choice 1\r
+TypeOne.c2=Choice 2\r
+TypeOne.c3=Choice 3\r
+TypeOne.c4=Choice 4\r
diff --git a/taxeditor.product b/taxeditor.product
new file mode 100644 (file)
index 0000000..56c9303
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<?pde version="3.1"?>\r
+\r
+<product name="Taxonomic Editor" id="eu.etaxonomy.taxeditor.product" application="eu.etaxonomy.taxeditor.application" useFeatures="false">\r
+\r
+   <aboutInfo>\r
+      <image path="logo_edit.gif"/>\r
+      <text>\r
+         Taxonomic Editor 
+(c) 2007 European Distributed Institute of Taxonomy
+
+Thanks to our worldwide fan community and Jesus.\r
+      </text>\r
+   </aboutInfo>\r
+\r
+   <configIni use="default"/>\r
+\r
+   <launcherArgs>\r
+      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>\r
+   </launcherArgs>\r
+\r
+   <windowImages i16="icons/edit_16x16.gif"/>\r
+\r
+   <splash\r
+      location="eu.etaxonomy.taxeditor"\r
+      startupProgressRect="5,5,45,105"\r
+      startupMessageRect="7,252,445,20"\r
+      startupForegroundColor="FFFFFF" />\r
+   <launcher name="taxeditor">\r
+      <solaris/>\r
+      <win useIco="false">\r
+         <bmp\r
+            winSmallLow="edit_16x16.bmp"/>\r
+      </win>\r
+   </launcher>\r
+\r
+\r
+   <vm>\r
+   </vm>\r
+\r
+   <plugins>\r
+      <plugin id="com.ibm.icu"/>\r
+      <plugin id="eu.etaxonomy.taxeditor"/>\r
+      <plugin id="javax.servlet"/>\r
+      <plugin id="org.eclipse.core.commands"/>\r
+      <plugin id="org.eclipse.core.contenttype"/>\r
+      <plugin id="org.eclipse.core.databinding"/>\r
+      <plugin id="org.eclipse.core.expressions"/>\r
+      <plugin id="org.eclipse.core.jobs"/>\r
+      <plugin id="org.eclipse.core.runtime"/>\r
+      <plugin id="org.eclipse.core.runtime.compatibility.auth"/>\r
+      <plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>\r
+      <plugin id="org.eclipse.equinox.app"/>\r
+      <plugin id="org.eclipse.equinox.common"/>\r
+      <plugin id="org.eclipse.equinox.preferences"/>\r
+      <plugin id="org.eclipse.equinox.registry"/>\r
+      <plugin id="org.eclipse.help"/>\r
+      <plugin id="org.eclipse.jface"/>\r
+      <plugin id="org.eclipse.jface.databinding"/>\r
+      <plugin id="org.eclipse.osgi"/>\r
+      <plugin id="org.eclipse.osgi.services"/>\r
+      <plugin id="org.eclipse.swt"/>\r
+      <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>\r
+      <plugin id="org.eclipse.ui"/>\r
+      <plugin id="org.eclipse.ui.workbench"/>\r
+   </plugins>\r
+\r
+</product>\r