Project

General

Profile

Download (1.93 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.jaxb.JaxbExportConfigurator;
19
import eu.etaxonomy.taxeditor.store.CdmStore;
20

    
21
/**
22
 * <p>JaxbExportWizard class.</p>
23
 *
24
 * @author n.hoffmann
25
 * @created 15.06.2009
26
 * @version 1.0
27
 */
28
public class JaxbExportWizard extends AbstractExportWizard<JaxbExportConfigurator> {
29

    
30
	private ExportToFileDestinationWizardPage page;
31

    
32
	private JaxbExportConfigurator configurator;
33

    
34
	/* (non-Javadoc)
35
	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
36
	 */
37
	/** {@inheritDoc} */
38
	public void init(IWorkbench workbench, IStructuredSelection selection) {
39
		this.setWindowTitle("JAXB Export");
40
		this.configurator = CdmStore.getExportHandler().JaxbConfigurator();
41
	}
42
	
43
	/* (non-Javadoc)
44
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
45
	 */
46
	/** {@inheritDoc} */
47
	@Override
48
	public boolean performFinish() {
49
		
50
		String urlString = page.getFolderText() + File.separator + page.getExportFileName();
51
		
52
		configurator.setDestination(urlString);
53
		
54
		CdmStore.getExportHandler().run(configurator);
55
		
56
		return true;
57
	}
58

    
59
	/* (non-Javadoc)
60
	 * @see org.eclipse.jface.wizard.Wizard#addPages()
61
	 */
62
	/** {@inheritDoc} */
63
	@Override
64
	public void addPages() {
65
		super.addPages();
66
				
67
		page = ExportToFileDestinationWizardPage.Jaxb();
68
		addPage(page);
69
	}
70

    
71
	/* (non-Javadoc)
72
	 * @see eu.etaxonomy.taxeditor.io.AbstractExportWizard#getConfigurator()
73
	 */
74
	/** {@inheritDoc} */
75
	@Override
76
	public JaxbExportConfigurator getConfigurator() {
77
		return configurator;
78
	}
79
	
80

    
81
}
(13-13/20)