package eu.etaxonomy.taxeditor.io.wizard;
+import java.io.File;
+import java.net.URI;
+
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
public static final String PAGE_NAME = "ClassificationChooserWizardPage";
+ //classification
private Text textClassification;
private Classification classification;
private Button btnBrowseClassification;
private Button btnClear;
+ //report
+ private FileDialog fileDialogReport;
+ private Text textFileReport;
+
/**
* <p>Constructor for ImportFromFileDataSourceWizardPage.</p>
*
* @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.");
}
gridLayout.numColumns = 4;
composite.setLayout(gridLayout);
+ //classification
Label label = new Label(composite, SWT.NONE);
label.setText("Classification");
textClassification = new Text(composite, SWT.NONE);
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);
}
}
}
-
/**
* @return the classification
*/
public Classification getClassification() {
return classification;
}
+
+ public URI getReportUri(){
+ return new File(textFileReport.getText()).toURI();
+ }
}