Handle "Finish" button correctly for import wizards
authorp.plitzner <p.plitzner@bgbm.org>
Tue, 23 Feb 2016 08:20:13 +0000 (09:20 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 23 Feb 2016 14:50:15 +0000 (15:50 +0100)
 - "Finish" is only enabled when a file is selected #5589

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbstractImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ImportFromFileDataSourceWizardPage.java

index 4c946a9a53b2541f01ca7ef3267303f6bb945179..e4623afb1d9a788d02750073cc2856f6572150c8 100644 (file)
@@ -101,7 +101,7 @@ public abstract class AbstractImportWizard<CONFIG extends IIoConfigurator> exten
         */
        @Override
        public boolean canFinish() {
         */
        @Override
        public boolean canFinish() {
-           return !existUnsavedEditors();
+           return !existUnsavedEditors() && super.canFinish();
        }
 
        /**
        }
 
        /**
index 2d2415d96cc18e0e627bfef250e48c1bd33c6322..3c7f5516d558466ca6888c6a3544e5a9dc8b09e4 100644 (file)
@@ -25,6 +25,8 @@ import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
+import eu.etaxonomy.cdm.common.CdmUtils;
+
 /**
  * <p>ImportFromFileDataSourceWizardPage class.</p>
  *
 /**
  * <p>ImportFromFileDataSourceWizardPage class.</p>
  *
@@ -139,5 +141,9 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage {
                return getFile().toURI();
        }
 
                return getFile().toURI();
        }
 
+       @Override
+       public boolean isPageComplete() {
+               return CdmUtils.isNotBlank(text_file.getText());
+       }
 
 }
 
 }