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 javax.naming.OperationNotSupportedException;
|
16
|
|
17
|
import org.apache.log4j.Logger;
|
18
|
import org.eclipse.jface.viewers.IStructuredSelection;
|
19
|
import org.eclipse.ui.IImportWizard;
|
20
|
import org.eclipse.ui.IWorkbench;
|
21
|
|
22
|
import eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator;
|
23
|
import eu.etaxonomy.taxeditor.singlesource.ImplementationLoader;
|
24
|
import eu.etaxonomy.taxeditor.singlesource.io.wizard.ImportFromFileDataSourceWizardPageFacade;
|
25
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
26
|
|
27
|
/**
|
28
|
* <p>EndnoteImportWizard class.</p>
|
29
|
*
|
30
|
* @author n.hoffmann
|
31
|
* @created Sep 18, 2009
|
32
|
* @version 1.0
|
33
|
*/
|
34
|
public class EndnoteImportWizard extends AbstractImportWizard<EndnoteImportConfigurator> implements IImportWizard {
|
35
|
private static final Logger logger = Logger.getLogger(EndnoteImportWizard.class);
|
36
|
|
37
|
private EndnoteImportConfigurator configurator;
|
38
|
|
39
|
private ImportFromFileDataSourceWizardPageFacade dataSourcePage;
|
40
|
|
41
|
/* (non-Javadoc)
|
42
|
* @see org.eclipse.jface.wizard.Wizard#performFinish()
|
43
|
*/
|
44
|
/** {@inheritDoc} */
|
45
|
@Override
|
46
|
public boolean performFinish() {
|
47
|
|
48
|
File file = dataSourcePage.getFile();
|
49
|
configurator.setSource(file.toURI());
|
50
|
|
51
|
CdmStore.getImportManager().run(configurator);
|
52
|
|
53
|
return true;
|
54
|
}
|
55
|
|
56
|
/* (non-Javadoc)
|
57
|
* @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
|
58
|
*/
|
59
|
/** {@inheritDoc} */
|
60
|
@Override
|
61
|
public void addPages() {
|
62
|
super.addPages();
|
63
|
|
64
|
dataSourcePage = ImportFromFileDataSourceWizardPageFacade.XML();
|
65
|
addPage(dataSourcePage);
|
66
|
}
|
67
|
|
68
|
/* (non-Javadoc)
|
69
|
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
|
70
|
*/
|
71
|
/** {@inheritDoc} */
|
72
|
public void init(IWorkbench workbench, IStructuredSelection selection) {
|
73
|
super.init(workbench, selection);
|
74
|
configurator = CdmStore.getImportManager().EndnoteConfigurator();
|
75
|
}
|
76
|
|
77
|
/* (non-Javadoc)
|
78
|
* @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#getConfigurator()
|
79
|
*/
|
80
|
/** {@inheritDoc} */
|
81
|
@Override
|
82
|
public EndnoteImportConfigurator getConfigurator() {
|
83
|
return configurator;
|
84
|
}
|
85
|
}
|