Project

General

Profile

Download (1.96 KB) Statistics
| Branch: | Tag: | Revision:
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>
23
 * TcsExportWizard class.
24
 * </p>
25
 * 
26
 * @author n.hoffmann
27
 * @created 15.06.2009
28
 * @version 1.0
29
 */
30
public class TcsExportWizard extends
31
		AbstractExportWizard<TcsXmlExportConfigurator> {
32
	private TcsXmlExportConfigurator configurator;
33
	private ExportToFileDestinationWizardPage page;
34

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

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

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

    
50
		return true;
51
	}
52

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

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

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

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

    
89
}
(24-24/25)