1 |
f2c1e4b7
|
Katja Luther
|
// $Id$
|
2 |
|
|
/**
|
3 |
|
|
* Copyright (C) 2007 EDIT
|
4 |
|
|
* European Distributed Institute of Taxonomy
|
5 |
|
|
* http://www.e-taxonomy.eu
|
6 |
|
|
*
|
7 |
|
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9 |
|
|
*/
|
10 |
|
|
|
11 |
|
|
package eu.etaxonomy.taxeditor.io.wizard;
|
12 |
|
|
|
13 |
|
|
import java.io.File;
|
14 |
|
|
|
15 |
|
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
16 |
|
|
import org.eclipse.swt.widgets.Combo;
|
17 |
|
|
import org.eclipse.ui.IWorkbench;
|
18 |
|
|
|
19 |
|
|
import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;
|
20 |
|
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
21 |
|
|
|
22 |
|
|
/**
|
23 |
|
|
* @author k.luther
|
24 |
|
|
* @created Apr. 12, 2015
|
25 |
|
|
* @version 1.0
|
26 |
|
|
*/
|
27 |
|
|
public class CsvNameExportWizard extends AbstractExportWizard<CsvNameExportConfigurator> {
|
28 |
|
|
|
29 |
|
|
protected CsvNameExportConfigurator configurator;
|
30 |
|
|
protected ExportToFileDestinationWizardPage page;
|
31 |
|
|
|
32 |
|
|
private final String description = "Export the names of the currently selected database into Semicolon Separated Value format.";
|
33 |
|
|
/*
|
34 |
|
|
* (non-Javadoc)
|
35 |
|
|
*
|
36 |
|
|
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
|
37 |
|
|
* org.eclipse.jface.viewers.IStructuredSelection)
|
38 |
|
|
*/
|
39 |
|
|
@Override
|
40 |
|
|
public void init(IWorkbench workbench, IStructuredSelection selection) {
|
41 |
|
|
configurator = CsvNameExportConfigurator.NewInstance(null,null);
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
/*
|
45 |
|
|
* (non-Javadoc)
|
46 |
|
|
*
|
47 |
|
|
* @see
|
48 |
|
|
* eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
|
49 |
|
|
*/
|
50 |
|
|
@Override
|
51 |
|
|
public CsvNameExportConfigurator getConfigurator() {
|
52 |
|
|
return configurator;
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
/*
|
56 |
|
|
* (non-Javadoc)
|
57 |
|
|
*
|
58 |
|
|
* @see org.eclipse.jface.wizard.Wizard#performFinish()
|
59 |
|
|
*/
|
60 |
|
|
@Override
|
61 |
|
|
public boolean performFinish() {
|
62 |
|
|
String urlString = page.getFolderText() + File.separator
|
63 |
|
|
+ page.getExportFileName();
|
64 |
|
|
|
65 |
|
|
final Combo combo = page.getCombo();
|
66 |
|
|
|
67 |
|
|
configurator.setDestination(new File(urlString));
|
68 |
|
|
|
69 |
|
|
CdmStore.getExportManager().run(configurator);
|
70 |
|
|
|
71 |
|
|
return true;
|
72 |
|
|
}
|
73 |
|
|
|
74 |
|
|
/*
|
75 |
|
|
* (non-Javadoc)
|
76 |
|
|
*
|
77 |
|
|
* @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
|
78 |
|
|
*/
|
79 |
|
|
@Override
|
80 |
|
|
public void addPages() {
|
81 |
|
|
//TODO create page with drop down menu for export for single classification.
|
82 |
|
|
// super.addPages();
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
//standard page
|
86 |
|
|
page = ExportToFileDestinationWizardPage.CsvNames();
|
87 |
|
|
|
88 |
|
|
addPage(page);
|
89 |
|
|
}
|
90 |
|
|
}
|
91 |
|
|
|