Project

General

Profile

Download (2.23 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.core.runtime.jobs.Job;
16
import org.eclipse.jface.viewers.IStructuredSelection;
17
import org.eclipse.ui.IWorkbench;
18
import org.eclipse.ui.progress.IProgressConstants;
19

    
20
import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
21
import eu.etaxonomy.taxeditor.store.CdmStore;
22

    
23
/**
24
 * <p>SddExportWizard class.</p>
25
 *
26
 * @author n.hoffmann
27
 * @created Jun 16, 2010
28
 * @version 1.0
29
 */
30
public class SddExportWizard extends AbstractExportWizard<SDDExportConfigurator> {
31

    
32
	private ExportToFileDestinationWizardPage page;
33

    
34
	private SDDExportConfigurator configurator;
35

    
36
	/* (non-Javadoc)
37
	 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
38
	 */
39
	/** {@inheritDoc} */
40
	@Override
41
	public SDDExportConfigurator getConfigurator() {
42
		return configurator;
43
	}
44

    
45
	/* (non-Javadoc)
46
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
47
	 */
48
	/** {@inheritDoc} */
49
	@Override
50
	public boolean performFinish() {
51
	    File file = new File(page.getFolderText() + File.separator + page.getExportFileName());
52
        // create job
53
        Job job = CdmStore.getExportManager().createIOServiceJob(configurator, file);
54
        // configure the job
55
        job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
56
        job.setUser(true);
57
        // schedule job
58
        job.schedule();
59
	    
60
	    return true;
61
	}
62

    
63
	/*
64
	 * (non-Javadoc)
65
	 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
66
	 */
67
	/** {@inheritDoc} */
68
	@Override
69
	public void addPages() {
70
		super.addPages();
71

    
72
		page = ExportToFileDestinationWizardPage.Sdd();
73
		addPage(page);
74
	}
75

    
76
	/* (non-Javadoc)
77
	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
78
	 */
79
	/** {@inheritDoc} */
80
	@Override
81
    public void init(IWorkbench workbench, IStructuredSelection selection) {
82
		this.setWindowTitle("SDD Export");
83
		this.configurator = CdmStore.getExportManager().SddConfigurator();
84
	}
85
}
(21-21/25)