Project

General

Profile

Download (2.01 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.IImportWizard;
17
import org.eclipse.ui.IWorkbench;
18

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

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

    
31
	private EndnoteImportConfigurator configurator;
32

    
33
	private ImportFromFileDataSourceWizardPage dataSourcePage;
34

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

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

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