ref #6190 removing svn property place holder in first line of code - java files
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / io / wizard / DarwinCoreArchiveExportWizard.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.taxeditor.io.wizard;
11
12 import java.io.File;
13
14 import org.eclipse.jface.viewers.IStructuredSelection;
15 import org.eclipse.ui.IWorkbench;
16
17 import eu.etaxonomy.cdm.io.dwca.out.DwcaTaxExportConfigurator;
18 import eu.etaxonomy.taxeditor.store.CdmStore;
19
20 /**
21 * @author n.hoffmann
22 * @created May 2, 2011
23 * @version 1.0
24 */
25 public class DarwinCoreArchiveExportWizard extends
26 AbstractExportWizard<DwcaTaxExportConfigurator> {
27
28 private DwcaTaxExportConfigurator configurator;
29 private ExportToFileDestinationWizardPage page;
30
31 /*
32 * (non-Javadoc)
33 *
34 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
35 * org.eclipse.jface.viewers.IStructuredSelection)
36 */
37 @Override
38 public void init(IWorkbench workbench, IStructuredSelection selection) {
39 configurator = DwcaTaxExportConfigurator.NewInstance(null, null, null);
40 }
41
42 /*
43 * (non-Javadoc)
44 *
45 * @see
46 * eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
47 */
48 @Override
49 public DwcaTaxExportConfigurator getConfigurator() {
50 return configurator;
51 }
52
53 /*
54 * (non-Javadoc)
55 *
56 * @see org.eclipse.jface.wizard.Wizard#performFinish()
57 */
58 @Override
59 public boolean performFinish() {
60 String urlString = page.getFolderText() + File.separator
61 + page.getExportFileName();
62
63 configurator.setDestination(new File(urlString));
64
65 CdmStore.getExportManager().run(configurator);
66
67 return true;
68 }
69
70 /*
71 * (non-Javadoc)
72 *
73 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
74 */
75 @Override
76 public void addPages() {
77 super.addPages();
78
79 page = ExportToFileDestinationWizardPage.Dwca();
80 addPage(page);
81 }
82 }