export of csv files with name informations and for Print output(for caryophyllales)
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / io / wizard / CsvNameExportWizard.java
1 // $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 import java.util.HashSet;
15 import java.util.List;
16 import java.util.UUID;
17
18 import org.eclipse.jface.viewers.IStructuredSelection;
19 import org.eclipse.swt.widgets.Combo;
20 import org.eclipse.ui.IWorkbench;
21
22 import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator;
23 import eu.etaxonomy.cdm.model.taxon.Classification;
24 import eu.etaxonomy.taxeditor.store.CdmStore;
25
26 /**
27 * @author k.luther
28 * @created Apr. 12, 2015
29 * @version 1.0
30 */
31 public class CsvNameExportWizard extends AbstractExportWizard<CsvNameExportConfigurator> {
32
33 protected CsvNameExportConfigurator configurator;
34 protected ExportToFileDestinationWizardPage page;
35
36 private final String description = "Export the names of the currently selected database into Semicolon Separated Value format.";
37 /*
38 * (non-Javadoc)
39 *
40 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
41 * org.eclipse.jface.viewers.IStructuredSelection)
42 */
43 @Override
44 public void init(IWorkbench workbench, IStructuredSelection selection) {
45 configurator = CsvNameExportConfigurator.NewInstance(null,null);
46 }
47
48 /*
49 * (non-Javadoc)
50 *
51 * @see
52 * eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
53 */
54 @Override
55 public CsvNameExportConfigurator getConfigurator() {
56 return configurator;
57 }
58
59 /*
60 * (non-Javadoc)
61 *
62 * @see org.eclipse.jface.wizard.Wizard#performFinish()
63 */
64 @Override
65 public boolean performFinish() {
66 String urlString = page.getFolderText() + File.separator
67 + page.getExportFileName();
68
69 final Combo combo = page.getCombo();
70
71 configurator.setDestination(new File(urlString));
72
73 CdmStore.getExportManager().run(configurator);
74
75 return true;
76 }
77
78 /*
79 * (non-Javadoc)
80 *
81 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
82 */
83 @Override
84 public void addPages() {
85 //TODO create page with drop down menu for export for single classification.
86 // super.addPages();
87
88
89 //standard page
90 page = ExportToFileDestinationWizardPage.CsvNames();
91
92 addPage(page);
93 }
94 }
95