ref #8248 Split import wizard page
authorPatrick Plitzner <p.plitzner@bgbm.org>
Fri, 26 Apr 2019 07:59:46 +0000 (09:59 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Fri, 26 Apr 2019 07:59:46 +0000 (09:59 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileAndChooseVocIdWizardPageE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileDataSourceWithReferenceWizardPage.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileDataSourceWizardPage.java [moved from eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileDataSourceWizardPageE4.java with 63% similarity]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/abcd/AbcdImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/SpecimenCdmExcelImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/taxa/ExcelNormalExplicitTaxaImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ris/RISImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/sdd/SddImportWizardE4.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/tcs/TcsImportWizardE4.java

index ec26ada..8dba54e 100644 (file)
@@ -34,7 +34,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @date 04.05.2017
  *
  */
-public class ImportFromFileAndChooseVocIdWizardPageE4 extends ImportFromFileDataSourceWizardPageE4 {
+public class ImportFromFileAndChooseVocIdWizardPageE4 extends ImportFromFileDataSourceWithReferenceWizardPage {
 
     private Combo vocabularyCombo;
     UUID vocUuid;
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileDataSourceWithReferenceWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/ImportFromFileDataSourceWithReferenceWizardPage.java
new file mode 100644 (file)
index 0000000..3418760
--- /dev/null
@@ -0,0 +1,59 @@
+/**
+* Copyright (C) 2007 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.io.e4.in;
+
+import javax.inject.Inject;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ *
+ * @author pplitzner
+ * @since Oct 5, 2017
+ *
+ */
+public class ImportFromFileDataSourceWithReferenceWizardPage extends ImportFromFileDataSourceWizardPage {
+
+       private Text textReferenceString;
+
+    protected Text text_source;
+
+    @Inject
+       public ImportFromFileDataSourceWithReferenceWizardPage() {
+        super();
+       }
+
+       /** {@inheritDoc} */
+       @Override
+    public void createControl(Composite parent) {
+               super.createControl(parent);
+
+               Label labelRef = new Label(composite, SWT.NONE);
+               labelRef.setText("Default import source reference");
+        new Label(composite, SWT.NONE);
+        textReferenceString = new Text(composite, SWT.NONE);
+        textReferenceString.setEnabled(true);
+        textReferenceString.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
+               new Label(composite, SWT.NONE);
+       }
+
+       public Text getTextReferenceString() {
+               return textReferenceString;
+       }
+
+       public void setTextReferenceString(Text textReferenceString) {
+               this.textReferenceString = textReferenceString;
+       }
+
+}
@@ -34,19 +34,20 @@ import eu.etaxonomy.cdm.common.CdmUtils;
  * @since Oct 5, 2017
  *
  */
-public class ImportFromFileDataSourceWizardPageE4 extends WizardPage {
+public class ImportFromFileDataSourceWizardPage extends WizardPage {
 
-       public static final String PAGE_NAME = "CdmXmlDataSourceWizardPage";
+    public static final String PAGE_NAME = "ImportDataSourceWizardPage";
 
        private String[] extensions = {"*.xml"};
 
        private FileDialog fileDialog;
-       private Text textReferenceString;
 
     protected Text text_source;
 
+    protected Composite composite;
+
     @Inject
-       public ImportFromFileDataSourceWizardPageE4() {
+       public ImportFromFileDataSourceWizardPage() {
                super(PAGE_NAME);
 
                setTitle("Xml File");
@@ -63,12 +64,12 @@ public class ImportFromFileDataSourceWizardPageE4 extends WizardPage {
        /** {@inheritDoc} */
        @Override
     public void createControl(Composite parent) {
-               final Composite composite = new Composite(parent, SWT.NULL);
+               composite = new Composite(parent, SWT.NULL);
 
                setPageComplete(false);
 
                GridLayout gridLayout = new GridLayout();
-               gridLayout.numColumns = 3;
+               gridLayout.numColumns = 2;
                composite.setLayout(gridLayout);
 
                Label folderLabel = new Label(composite, SWT.NONE);
@@ -77,6 +78,7 @@ public class ImportFromFileDataSourceWizardPageE4 extends WizardPage {
                fileDialog = new FileDialog(parent.getShell());
 
                fileDialog.setFilterExtensions(extensions);
+               new Label(composite, SWT.NONE);
 
                text_source = new Text(composite, SWT.BORDER);
                text_source.setEditable(false);
@@ -88,40 +90,25 @@ public class ImportFromFileDataSourceWizardPageE4 extends WizardPage {
 
                button.addSelectionListener(new SelectionAdapter(){
 
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               String path = fileDialog.open();
-                               if(path!=null){
-                                   text_source.setText(path);
-                                   setPageComplete(isPageComplete());
-                               }
-                       }
+                   @Override
+                   public void widgetSelected(SelectionEvent e) {
+                       String path = fileDialog.open();
+                       if(path!=null){
+                           text_source.setText(path);
+                           setPageComplete(isPageComplete());
+                       }
+                   }
 
                });
 
-               Label labelRef = new Label(composite, SWT.NONE);
-        labelRef.setText("Default import souce reference");
-        labelRef.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
-        textReferenceString = new Text(composite, SWT.NONE);
-        textReferenceString.setEnabled(true);
-        GridData gd_textReferenceString = new GridData(SWT.LEFT, SWT.TOP, true, true, 1, 1);
-        gd_textReferenceString.widthHint = 229;
-        textReferenceString.setLayoutData(gd_textReferenceString);
-               setControl(composite);
+
+        setControl(composite);
        }
 
        public File getFile() {
                return new File(text_source.getText());
        }
 
-       public Text getTextReferenceString() {
-               return textReferenceString;
-       }
-
-       public void setTextReferenceString(Text textReferenceString) {
-               this.textReferenceString = textReferenceString;
-       }
-
     public URI getUri() {
                return getFile().toURI();
        }
index 4f463c5..8453003 100644 (file)
@@ -22,7 +22,7 @@ import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
-import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -35,7 +35,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
 public class AbcdImportWizardE4 extends AbstractImportWizardE4<Abcd206ImportConfigurator> {
 
        private Abcd206ImportConfigurator configurator;
-       private ImportFromFileDataSourceWizardPageE4 dataSourcePage;
+       private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage;
        private ClassificationChooserWizardPageE4 classificationChooserWizardPage;
 
        @Inject
@@ -84,7 +84,7 @@ public class AbcdImportWizardE4 extends AbstractImportWizardE4<Abcd206ImportConf
 
                classificationChooserWizardPage = ContextInjectionFactory.make(ClassificationChooserWizardPageE4.class, context);
 
-               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWizardPageE4.class, context);
+               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWithReferenceWizardPage.class, context);
 
                addPage(classificationChooserWizardPage);
                addPage(dataSourcePage);
index d1677e2..eed2c80 100644 (file)
@@ -17,7 +17,7 @@ import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
 import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
-import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -32,7 +32,7 @@ public class SpecimenCdmExcelImportWizardE4 extends AbstractImportWizardE4<Speci
 
     private SpecimenCdmExcelImportConfigurator configurator;
 
-       private ImportFromFileDataSourceWizardPageE4 dataSourcePage;
+       private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage;
 
        @Inject
        public SpecimenCdmExcelImportWizardE4(IEclipseContext context, EPartService partService) {
@@ -64,7 +64,7 @@ public class SpecimenCdmExcelImportWizardE4 extends AbstractImportWizardE4<Speci
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWizardPageE4.class, context);
+               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWithReferenceWizardPage.class, context);
         dataSourcePage.setTitle("Choose Specimen CDM Excel");
         dataSourcePage.setDescription("Please choose an xls file in the SpecimenCdmExcel format.");
         dataSourcePage.setExtensions(new String[]{"*.xlsx", "*.xls", "*.*"});
index ddf2e5e..028f07b 100644 (file)
@@ -37,7 +37,7 @@ import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
 import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
 import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
-import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -52,7 +52,7 @@ public class ExcelNormalExplicitTaxaImportWizardE4 extends AbstractImportWizardE
 
     private NormalExplicitImportConfigurator configurator;
 
-       private ImportFromFileDataSourceWizardPageE4 dataSourcePage;
+       private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage;
        private static final Logger logger = Logger.getLogger(ExcelNormalExplicitTaxaImportWizardE4.class);
 
        @Inject
@@ -108,7 +108,7 @@ public class ExcelNormalExplicitTaxaImportWizardE4 extends AbstractImportWizardE
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-           dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWizardPageE4.class, context);
+           dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWithReferenceWizardPage.class, context);
                dataSourcePage.setTitle("Choose NormalExplicit");
                dataSourcePage.setDescription("Please choose an xls file in the NormalExplicit format.");
                dataSourcePage.setExtensions(new String[]{"*.xlsx", "*.xls", "*.*"});
index fcaf079..661c2c3 100644 (file)
@@ -30,7 +30,7 @@ import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.reference.ris.in.RisReferenceImportConfigurator;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
 import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
-import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.io.wizard.ExcelDistributionUpdateWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -43,7 +43,7 @@ public class RISImportWizardE4 extends AbstractImportWizardE4<RisReferenceImport
 
     private RisReferenceImportConfigurator configurator;
 
-    private ImportFromFileDataSourceWizardPageE4 dataSourcePage;
+    private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage;
 
     private static final Logger logger = Logger.getLogger(ExcelDistributionUpdateWizard.class);
 
@@ -107,7 +107,7 @@ public class RISImportWizardE4 extends AbstractImportWizardE4<RisReferenceImport
     }
 
     private void addDataSourcePage(){
-        dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWizardPageE4.class, context);
+        dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWithReferenceWizardPage.class, context);
         dataSourcePage.setTitle("Choose Ris File");
         dataSourcePage.setDescription("Please choose a file in RIS format.");
         dataSourcePage.setExtensions(new String[]{"*.txt"});
index f9d33a1..e91dc00 100644 (file)
@@ -23,7 +23,7 @@ import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.sdd.in.SDDImportConfigurator;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
-import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -37,7 +37,7 @@ public class SddImportWizardE4 extends AbstractImportWizardE4<SDDImportConfigura
 
     private SDDImportConfigurator configurator;
 
-       private ImportFromFileDataSourceWizardPageE4 dataSourcePage;
+       private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage;
 
        @Inject
        public SddImportWizardE4(IEclipseContext context, EPartService partService) {
@@ -53,7 +53,7 @@ public class SddImportWizardE4 extends AbstractImportWizardE4<SDDImportConfigura
        @Override
        public void addPages() {
 
-               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWizardPageE4.class, context);
+               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWithReferenceWizardPage.class, context);
         dataSourcePage.setTitle("Choose File");
         dataSourcePage.setDescription("Please choose an XML file in the SDD format.");
         dataSourcePage.setExtensions(new String[]{"*.xml", "*.sdd"});
index 4e0b403..789ac3a 100644 (file)
@@ -26,7 +26,7 @@ import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
 import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4;
 import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4;
-import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPageE4;
+import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage;
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -41,7 +41,7 @@ public class TcsImportWizardE4 extends AbstractImportWizardE4<TcsXmlImportConfig
 
     private TcsXmlImportConfigurator configurator;
 
-       private ImportFromFileDataSourceWizardPageE4 dataSourcePage;
+       private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage;
 
        @Inject
        public TcsImportWizardE4(IEclipseContext context, EPartService partService) {
@@ -87,7 +87,7 @@ public class TcsImportWizardE4 extends AbstractImportWizardE4<TcsXmlImportConfig
        /** {@inheritDoc} */
        @Override
        public void addPages() {
-               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWizardPageE4.class, context);
+               dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWithReferenceWizardPage.class, context);
                addPage(dataSourcePage);
                super.addPages();
        }