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