Add space between label and textfield for all wizards #5436
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 5 Apr 2016 08:58:12 +0000 (10:58 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 5 Apr 2016 08:58:12 +0000 (10:58 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/AbstractEntityCollectionElementWizardPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/AbstractCdmEntityWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameRelationshipWizardPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SynonymRelationshipWizardPage.java

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/AbstractEntityCollectionElementWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/AbstractEntityCollectionElementWizardPage.java
new file mode 100644 (file)
index 0000000..4e78d2c
--- /dev/null
@@ -0,0 +1,65 @@
+// $Id$
+/**
+* Copyright (C) 2016 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui;
+
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
+import eu.etaxonomy.taxeditor.ui.element.RootElement;
+
+/**
+ * @author pplitzner
+ * @date Mar 30, 2016
+ *
+ */
+public abstract class AbstractEntityCollectionElementWizardPage extends WizardPage implements
+IPropertyChangeListener {
+
+    protected CdmFormFactory formFactory;
+
+    protected RootElement rootElement;
+
+    protected AbstractEntityCollectionElementWizardPage(String pageName) {
+        super(pageName);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void createControl(Composite parent) {
+        this.setPageComplete(false);
+
+        Composite control = formFactory.createComposite(parent);
+
+        TableWrapLayout layout = LayoutConstants.LAYOUT(2, false);
+        layout.horizontalSpacing = 5;
+        control.setLayout(layout);
+
+        rootElement = new RootElement(formFactory, control);
+
+
+        setControl(control);
+
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void dispose() {
+        rootElement.removeElements();
+        formFactory.removePropertyChangeListener(this);
+        super.dispose();
+    }
+
+}
index 505a653a2f701fb19b4a378dbb5413ea58e52082..b017125b6e62fcf8d31136e42676c0328b81c98e 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
@@ -96,7 +97,9 @@ public abstract class AbstractCdmEntityWizardPage<T> extends WizardPage
                Composite control = formFactory.createComposite(scrolledForm.getBody());
                control.setLayoutData(LayoutConstants.FILL());
 
-               control.setLayout(LayoutConstants.LAYOUT(2, false));
+               TableWrapLayout layout = LayoutConstants.LAYOUT(2, false);
+               layout.horizontalSpacing = 5;
+        control.setLayout(layout);
                WizardPageRootElement rootElement = new WizardPageRootElement(
                                formFactory, control, getConversationHolder());
 
index 203141ac659bfb6153a6db23302fa7bd0898c861..e96d14cfff812f7182176d489e316fd3d9fd09b4 100644 (file)
@@ -12,7 +12,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 
@@ -20,10 +19,8 @@ import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.name.NameRelationship;
 import eu.etaxonomy.cdm.model.name.NameRelationshipType;
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.taxeditor.ui.AbstractEntityCollectionElementWizardPage;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
-import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
@@ -35,11 +32,9 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @created Jun 1, 2010
  * @version 1.0
  */
-public class NameRelationshipWizardPage extends WizardPage implements
+public class NameRelationshipWizardPage extends AbstractEntityCollectionElementWizardPage implements
                IPropertyChangeListener {
 
-       private final CdmFormFactory formFactory;
-
        private EntitySelectionElement<TaxonNameBase> selection_relatedTo;
 
        private TermComboElement<NameRelationshipType> combo_relationshipType;
@@ -50,8 +45,6 @@ public class NameRelationshipWizardPage extends WizardPage implements
 
        private TaxonNameBase toName;
 
-       private RootElement rootElement;
-
        /**
         * <p>
         * Constructor for NameRelationshipWizardPage.
@@ -83,13 +76,7 @@ public class NameRelationshipWizardPage extends WizardPage implements
        /** {@inheritDoc} */
        @Override
        public void createControl(Composite parent) {
-               this.setPageComplete(false);
-
-               Composite control = formFactory.createComposite(parent);
-
-               control.setLayout(LayoutConstants.LAYOUT(2, false));
-
-               rootElement = new RootElement(formFactory, control);
+           super.createControl(parent);
 
                combo_relationshipType = formFactory.createDefinedTermComboElement(TermType.NameRelationshipType,
                                                rootElement, "Name Relationship Type", null, SWT.NULL);
@@ -101,7 +88,6 @@ public class NameRelationshipWizardPage extends WizardPage implements
                                                "Related to", null, EntitySelectionElement.ALL,
                                                SWT.NULL);
 
-               setControl(control);
        }
 
        /**
@@ -132,11 +118,4 @@ public class NameRelationshipWizardPage extends WizardPage implements
                setPageComplete(complete);
        }
 
-       /** {@inheritDoc} */
-       @Override
-       public void dispose() {
-               rootElement.removeElements();
-               formFactory.removePropertyChangeListener(this);
-               super.dispose();
-       }
 }
index 84f8f47ea48415927391dc3260e37a576940d77f..e71682282562a7a25cee02e4278cf9ddf2610270 100644 (file)
@@ -11,7 +11,6 @@ package eu.etaxonomy.taxeditor.ui.section.name;
 
 import org.eclipse.jface.util.IPropertyChangeListener;
 import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Composite;
 
@@ -20,11 +19,9 @@ import eu.etaxonomy.cdm.model.taxon.Synonym;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
 import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.ui.AbstractEntityCollectionElementWizardPage;
 import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
-import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;
-import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
-import eu.etaxonomy.taxeditor.ui.element.RootElement;
 import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
 
 /**
@@ -32,9 +29,8 @@ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
  * @date 27.01.2014
  *
  */
-public class SynonymRelationshipWizardPage extends WizardPage implements IPropertyChangeListener {
+public class SynonymRelationshipWizardPage extends AbstractEntityCollectionElementWizardPage implements IPropertyChangeListener {
 
-    private final CdmFormFactory formFactory;
 
     private EntitySelectionElement<Taxon> selection_relatedTo;
 
@@ -54,7 +50,6 @@ public class SynonymRelationshipWizardPage extends WizardPage implements IProper
 
     private Taxon taxon;
 
-    private RootElement rootElement;
 
     /**
      * <p>
@@ -87,13 +82,7 @@ public class SynonymRelationshipWizardPage extends WizardPage implements IProper
     /** {@inheritDoc} */
     @Override
     public void createControl(Composite parent) {
-        this.setPageComplete(false);
-
-        Composite control = formFactory.createComposite(parent);
-
-        control.setLayout(LayoutConstants.LAYOUT(2, false));
-
-        rootElement = new RootElement(formFactory, control);
+        super.createControl(parent);
 
         combo_relationshipType = formFactory.createDefinedTermComboElement(TermType.SynonymRelationshipType,
                 rootElement, "Synonym Relationship Type", null, SWT.NULL);
@@ -109,7 +98,6 @@ public class SynonymRelationshipWizardPage extends WizardPage implements IProper
 
         checkboxPartial = formFactory.createCheckbox(rootElement, "Partial Synonym", null, SWT.NULL);
 
-        setControl(control);
     }
 
     /**
@@ -147,11 +135,4 @@ public class SynonymRelationshipWizardPage extends WizardPage implements IProper
         setPageComplete(complete);
     }
 
-    /** {@inheritDoc} */
-    @Override
-    public void dispose() {
-        rootElement.removeElements();
-        formFactory.removePropertyChangeListener(this);
-        super.dispose();
-    }
 }