Project

General

Profile

Download (2 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.wizard;
11

    
12
import java.io.File;
13

    
14
import org.eclipse.jface.viewers.IStructuredSelection;
15
import org.eclipse.ui.IImportWizard;
16
import org.eclipse.ui.IWorkbench;
17

    
18
import eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator;
19
import eu.etaxonomy.taxeditor.store.CdmStore;
20

    
21
/**
22
 * <p>EndnoteImportWizard class.</p>
23
 *
24
 * @author n.hoffmann
25
 * @created Sep 18, 2009
26
 * @version 1.0
27
 */
28
public class EndnoteImportWizard extends AbstractImportWizard<EndnoteImportConfigurator> implements IImportWizard {
29

    
30
	private EndnoteImportConfigurator configurator;
31

    
32
	private ImportFromFileDataSourceWizardPage dataSourcePage;
33

    
34
	/* (non-Javadoc)
35
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
36
	 */
37
	/** {@inheritDoc} */
38
	@Override
39
	public boolean performFinish() {
40
		
41
		File file = dataSourcePage.getFile();
42
		configurator.setSource(file.toURI());
43
		
44
		CdmStore.getImportManager().run(configurator);
45
		
46
		return true;
47
	}
48
	
49
	/* (non-Javadoc)
50
	 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
51
	 */
52
	/** {@inheritDoc} */
53
	@Override
54
	public void addPages() {
55
		super.addPages();
56
		
57
		dataSourcePage = ImportFromFileDataSourceWizardPage.XML();
58
		addPage(dataSourcePage);
59
	}
60

    
61
	/* (non-Javadoc)
62
	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
63
	 */
64
	/** {@inheritDoc} */
65
	public void init(IWorkbench workbench, IStructuredSelection selection) {
66
		super.init(workbench, selection);
67
		configurator =  CdmStore.getImportManager().EndnoteConfigurator();
68
	}
69

    
70
	/* (non-Javadoc)
71
	 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#getConfigurator()
72
	 */
73
	/** {@inheritDoc} */
74
	@Override
75
	public EndnoteImportConfigurator getConfigurator() {
76
		return configurator;
77
	}
78
}
(14-14/30)