Project

General

Profile

Download (1.95 KB) Statistics
| Branch: | Tag: | Revision:
1 2d9a13f7 n.hoffmann
// $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 c10e4c27 n.hoffmann
import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
19 2d9a13f7 n.hoffmann
import eu.etaxonomy.taxeditor.store.CdmStore;
20
21
/**
22 3be6ef3e n.hoffmann
 * <p>SddExportWizard class.</p>
23
 *
24 2d9a13f7 n.hoffmann
 * @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 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
38 2d9a13f7 n.hoffmann
	@Override
39
	public SDDExportConfigurator getConfigurator() {
40
		return configurator;
41
	}
42
43
	/* (non-Javadoc)
44
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
45
	 */
46 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
47 2d9a13f7 n.hoffmann
	@Override
48
	public boolean performFinish() {
49
		File file = new File(page.getFolderText() + File.separator + page.getExportFileName());
50
		
51
		configurator.setDestination(file);
52
		
53 db5e366d n.hoffmann
		CdmStore.getExportManager().run(configurator);
54 2d9a13f7 n.hoffmann
		
55
		return true;
56
	}
57
58
	/*
59
	 * (non-Javadoc)
60
	 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
61
	 */
62 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
63 2d9a13f7 n.hoffmann
	@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 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
75 2d9a13f7 n.hoffmann
	public void init(IWorkbench workbench, IStructuredSelection selection) {		
76
		this.setWindowTitle("SDD Export");
77 db5e366d n.hoffmann
		this.configurator = CdmStore.getExportManager().SddConfigurator();
78 2d9a13f7 n.hoffmann
	}
79
}