Project

General

Profile

Download (1.95 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.e4.out.sdd;
11

    
12
import java.io.File;
13

    
14
import javax.inject.Inject;
15

    
16
import org.eclipse.core.runtime.jobs.Job;
17
import org.eclipse.e4.core.contexts.IEclipseContext;
18
import org.eclipse.ui.progress.IProgressConstants;
19

    
20
import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
21
import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
22
import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage;
23
import eu.etaxonomy.taxeditor.store.CdmStore;
24

    
25
/**
26
 *
27
 * @author pplitzner
28
 * @since Oct 6, 2017
29
 *
30
 */
31
public class SddExportWizardE4 extends AbstractExportWizardE4<SDDExportConfigurator> {
32

    
33
	private ExportToFileDestinationWizardPage page;
34

    
35
	private SDDExportConfigurator configurator;
36

    
37
    @Inject
38
    public SddExportWizardE4(IEclipseContext context) {
39
        super(context);
40
    }
41

    
42
	/** {@inheritDoc} */
43
	@Override
44
	public SDDExportConfigurator getConfigurator() {
45
		return configurator;
46
	}
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
	/** {@inheritDoc} */
64
	@Override
65
	public void addPages() {
66
		super.addPages();
67

    
68
		page = ExportToFileDestinationWizardPage.Sdd(configurator);
69
		addPage(page);
70
	}
71

    
72
	/** {@inheritDoc} */
73
	@Override
74
    public void init() {
75
		this.setWindowTitle("SDD Export");
76
		this.configurator = CdmStore.getExportManager().SddConfigurator();
77
	}
78
}
(2-2/2)