3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.io
.wizard
;
16 import org
.apache
.log4j
.Logger
;
17 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
18 import org
.eclipse
.ui
.IImportWizard
;
19 import org
.eclipse
.ui
.IWorkbench
;
21 import eu
.etaxonomy
.cdm
.io
.reference
.endnote
.in
.EndnoteImportConfigurator
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
26 * @created Sep 18, 2009
29 public class EndnoteImportWizard
extends AbstractImportWizard
<EndnoteImportConfigurator
> implements IImportWizard
{
30 private static final Logger logger
= Logger
31 .getLogger(EndnoteImportWizard
.class);
33 private EndnoteImportConfigurator configurator
;
35 private ImportFromFileDataSourceWizardPage dataSourcePage
;
38 * @see org.eclipse.jface.wizard.Wizard#performFinish()
41 public boolean performFinish() {
43 String platformDependendFile
= dataSourcePage
.getFile();
46 // TcsXmlImport expects a string that can be used to instantiate a URL instance
47 // TODO consolidate import and exports regarding what may be passed in as source
48 // will construct a url string for now
50 File file
= new File(platformDependendFile
);
51 URI fileUri
= file
.toURI();
52 configurator
.setSource(fileUri
.toString());
54 CdmStore
.getImportHandler().run(configurator
);
60 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
63 public void addPages() {
66 dataSourcePage
= ImportFromFileDataSourceWizardPage
.XML();
67 addPage(dataSourcePage
);
71 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
73 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
74 configurator
= CdmStore
.getImportHandler().EndnoteConfigurator();
78 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#getConfigurator()
81 public EndnoteImportConfigurator
getConfigurator() {