From: Patric Plitzner
Date: Fri, 23 Jan 2015 09:51:29 +0000 (+0000)
Subject: - added file chooser for report file
X-Git-Tag: 3.6.0~247
X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/46f7e983cf21dd765e7191ae4e7e54318a7af4a7
- added file chooser for report file
---
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java
index 275c39d3d..36ec38a4e 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java
@@ -65,6 +65,7 @@ public class AbcdImportWizard extends AbstractImportWizardConstructor for ImportFromFileDataSourceWizardPage.
*
@@ -64,7 +75,7 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
* @return a {@link eu.etaxonomy.taxeditor.io.wizard.ClassificationChooserWizardPage} object.
*/
protected static ClassificationChooserWizardPage createPage(){
- return new ClassificationChooserWizardPage("Choose Classification", "Note: Selecting no classification will create a default one.");
+ return new ClassificationChooserWizardPage("Configure import destinations", "Note: Selecting no classification will create a default one.");
}
@@ -81,6 +92,7 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
gridLayout.numColumns = 4;
composite.setLayout(gridLayout);
+ //classification
Label label = new Label(composite, SWT.NONE);
label.setText("Classification");
textClassification = new Text(composite, SWT.NONE);
@@ -93,6 +105,38 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
btnClear.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif"));
btnClear.addListener(SWT.Selection, this);
+ //report
+ Label labelReportFile = new Label(composite, SWT.NONE);
+ labelReportFile.setText("Report File");
+
+ fileDialogReport = new FileDialog(parent.getShell());
+
+ fileDialogReport.setFilterExtensions(new String[]{"*.*"});
+
+ textFileReport = new Text(composite, SWT.BORDER);
+ textFileReport.setEditable(false);
+ textFileReport.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+
+ Button buttonReport = new Button(composite, SWT.PUSH);
+ buttonReport.setText("Browse...");
+
+ buttonReport.addSelectionListener(new SelectionAdapter(){
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ String path = fileDialogReport.open();
+ if(path!=null){
+ textFileReport.setText(path);
+ setPageComplete(true);
+ }
+ }
+
+ });
+
setControl(composite);
}
@@ -113,11 +157,14 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
}
}
-
/**
* @return the classification
*/
public Classification getClassification() {
return classification;
}
+
+ public URI getReportUri(){
+ return new File(textFileReport.getText()).toURI();
+ }
}