ref #6190 removing svn property place holder in first line of code - java files
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / io / wizard / SddExportWizard.java
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.core.runtime.jobs.Job;
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.ui.IWorkbench;
17 import org.eclipse.ui.progress.IProgressConstants;
18
19 import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
20 import eu.etaxonomy.taxeditor.store.CdmStore;
21
22 /**
23 * <p>SddExportWizard class.</p>
24 *
25 * @author n.hoffmann
26 * @created Jun 16, 2010
27 * @version 1.0
28 */
29 public class SddExportWizard extends AbstractExportWizard<SDDExportConfigurator> {
30
31 private ExportToFileDestinationWizardPage page;
32
33 private SDDExportConfigurator configurator;
34
35 /* (non-Javadoc)
36 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
37 */
38 /** {@inheritDoc} */
39 @Override
40 public SDDExportConfigurator getConfigurator() {
41 return configurator;
42 }
43
44 /* (non-Javadoc)
45 * @see org.eclipse.jface.wizard.Wizard#performFinish()
46 */
47 /** {@inheritDoc} */
48 @Override
49 public boolean performFinish() {
50 File file = new File(page.getFolderText() + File.separator + page.getExportFileName());
51 // create job
52 Job job = CdmStore.getExportManager().createIOServiceJob(configurator, file);
53 // configure the job
54 job.setProperty(IProgressConstants.KEEP_PROPERTY, true);
55 job.setUser(true);
56 // schedule job
57 job.schedule();
58
59 return true;
60 }
61
62 /*
63 * (non-Javadoc)
64 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
65 */
66 /** {@inheritDoc} */
67 @Override
68 public void addPages() {
69 super.addPages();
70
71 page = ExportToFileDestinationWizardPage.Sdd();
72 addPage(page);
73 }
74
75 /* (non-Javadoc)
76 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
77 */
78 /** {@inheritDoc} */
79 @Override
80 public void init(IWorkbench workbench, IStructuredSelection selection) {
81 this.setWindowTitle("SDD Export");
82 this.configurator = CdmStore.getExportManager().SddConfigurator();
83 }
84 }