2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.io
.wizard
;
14 import org
.eclipse
.core
.runtime
.jobs
.Job
;
15 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
16 import org
.eclipse
.swt
.widgets
.Combo
;
17 import org
.eclipse
.ui
.IWorkbench
;
18 import org
.eclipse
.ui
.progress
.IProgressConstants
;
20 import eu
.etaxonomy
.cdm
.io
.csv
.caryophyllales
.out
.CsvNameExportConfigurator
;
21 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * @created Apr. 12, 2015
28 public class CsvNameExportWizard
extends AbstractExportWizard
<CsvNameExportConfigurator
> {
30 protected CsvNameExportConfigurator configurator
;
31 protected ExportToFileDestinationWizardPage page
;
33 private final String description
= "Export the names of the currently selected database into Semicolon Separated Value format.";
37 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
38 * org.eclipse.jface.viewers.IStructuredSelection)
41 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
42 configurator
= CsvNameExportConfigurator
.NewInstance(null,null);
43 configurator
.setNamesOnly(true);
50 * eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
53 public CsvNameExportConfigurator
getConfigurator() {
60 * @see org.eclipse.jface.wizard.Wizard#performFinish()
63 public boolean performFinish() {
64 String urlString
= page
.getFolderText() + File
.separator
65 + page
.getExportFileName();
67 final Combo combo
= page
.getCombo();
68 configurator
.setClassificationUUID(page
.getSelectedClassificationUUID());
71 Job job
= CdmStore
.getExportManager().createIOServiceJob(configurator
, new File(urlString
));
73 job
.setProperty(IProgressConstants
.KEEP_PROPERTY
, true);
84 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
87 public void addPages() {
88 //TODO create page with drop down menu for export for single classification.
93 page
= ExportToFileDestinationWizardPage
.CsvNames();