Project

General

Profile

Download (1.97 KB) Statistics
| Branch: | Tag: | Revision:
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.tcsxml.out.TcsXmlExportConfigurator;
18
import eu.etaxonomy.taxeditor.store.CdmStore;
19

    
20
/**
21
 * <p>
22
 * TcsExportWizard class.
23
 * </p>
24
 * 
25
 * @author n.hoffmann
26
 * @created 15.06.2009
27
 * @version 1.0
28
 */
29
public class TcsExportWizard extends
30
		AbstractExportWizard<TcsXmlExportConfigurator> {
31
	private TcsXmlExportConfigurator configurator;
32
	private ExportToFileDestinationWizardPage page;
33

    
34
	/*
35
	 * (non-Javadoc)
36
	 * 
37
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
38
	 */
39
	/** {@inheritDoc} */
40
	@Override
41
	public boolean performFinish() {
42
		String urlString = page.getFolderText() + File.separator
43
				+ page.getExportFileName();
44

    
45
		configurator.setDestination(new File(urlString));
46

    
47
		CdmStore.getExportManager().run(configurator);
48

    
49
		return true;
50
	}
51

    
52
	/*
53
	 * (non-Javadoc)
54
	 * 
55
	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
56
	 * org.eclipse.jface.viewers.IStructuredSelection)
57
	 */
58
	/** {@inheritDoc} */
59
	public void init(IWorkbench workbench, IStructuredSelection selection) {
60
		configurator = TcsXmlExportConfigurator.NewInstance(null, null);
61
	}
62

    
63
	/*
64
	 * (non-Javadoc)
65
	 * 
66
	 * @see eu.etaxonomy.taxeditor.io.AbstractExportWizard#getConfigurator()
67
	 */
68
	/** {@inheritDoc} */
69
	@Override
70
	public TcsXmlExportConfigurator getConfigurator() {
71
		return configurator;
72
	}
73

    
74
	/*
75
	 * (non-Javadoc)
76
	 * 
77
	 * @see eu.etaxonomy.taxeditor.io.AbstractExportWizard#addPages()
78
	 */
79
	/** {@inheritDoc} */
80
	@Override
81
	public void addPages() {
82
		super.addPages();
83

    
84
		page = ExportToFileDestinationWizardPage.Tcs(configurator);
85
		addPage(page);
86
	}
87

    
88
}
(29-29/30)