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
|
package eu.etaxonomy.taxeditor.io.wizard;
|
10
|
|
11
|
import java.io.File;
|
12
|
|
13
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
14
|
import org.eclipse.ui.IWorkbench;
|
15
|
|
16
|
import eu.etaxonomy.cdm.io.tcsxml.out.TcsXmlExportConfigurator;
|
17
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
18
|
|
19
|
/**
|
20
|
* <p>
|
21
|
* TcsExportWizard class.
|
22
|
* </p>
|
23
|
*
|
24
|
* @author n.hoffmann
|
25
|
* @created 15.06.2009
|
26
|
*/
|
27
|
public class TcsExportWizard extends
|
28
|
AbstractExportWizard<TcsXmlExportConfigurator> {
|
29
|
private TcsXmlExportConfigurator configurator;
|
30
|
private ExportToFileDestinationWizardPage page;
|
31
|
|
32
|
/*
|
33
|
* (non-Javadoc)
|
34
|
*
|
35
|
* @see org.eclipse.jface.wizard.Wizard#performFinish()
|
36
|
*/
|
37
|
/** {@inheritDoc} */
|
38
|
@Override
|
39
|
public boolean performFinish() {
|
40
|
String urlString = page.getFolderText() + File.separator
|
41
|
+ page.getExportFileName();
|
42
|
|
43
|
configurator.setDestination(new File(urlString));
|
44
|
|
45
|
CdmStore.getExportManager().run(configurator);
|
46
|
|
47
|
return true;
|
48
|
}
|
49
|
|
50
|
/*
|
51
|
* (non-Javadoc)
|
52
|
*
|
53
|
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
|
54
|
* org.eclipse.jface.viewers.IStructuredSelection)
|
55
|
*/
|
56
|
/** {@inheritDoc} */
|
57
|
public void init(IWorkbench workbench, IStructuredSelection selection) {
|
58
|
configurator = TcsXmlExportConfigurator.NewInstance(null, null);
|
59
|
}
|
60
|
|
61
|
/*
|
62
|
* (non-Javadoc)
|
63
|
*
|
64
|
* @see eu.etaxonomy.taxeditor.io.AbstractExportWizard#getConfigurator()
|
65
|
*/
|
66
|
/** {@inheritDoc} */
|
67
|
@Override
|
68
|
public TcsXmlExportConfigurator getConfigurator() {
|
69
|
return configurator;
|
70
|
}
|
71
|
|
72
|
/*
|
73
|
* (non-Javadoc)
|
74
|
*
|
75
|
* @see eu.etaxonomy.taxeditor.io.AbstractExportWizard#addPages()
|
76
|
*/
|
77
|
/** {@inheritDoc} */
|
78
|
@Override
|
79
|
public void addPages() {
|
80
|
super.addPages();
|
81
|
|
82
|
page = ExportToFileDestinationWizardPage.Tcs(configurator);
|
83
|
addPage(page);
|
84
|
}
|
85
|
|
86
|
}
|