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