Revision 87baedee
Added by Katja Luther about 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/EndnoteImportWizard.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
11 | 11 |
|
12 | 12 |
import java.io.File; |
13 | 13 |
|
14 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
15 |
import org.eclipse.ui.IImportWizard; |
|
16 |
import org.eclipse.ui.IWorkbench; |
|
14 |
import javax.inject.Inject; |
|
15 |
|
|
16 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
17 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
|
17 | 18 |
|
18 | 19 |
import eu.etaxonomy.cdm.common.URI; |
19 | 20 |
import eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator; |
21 |
import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizardE4; |
|
22 |
import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPage; |
|
20 | 23 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
21 | 24 |
|
22 | 25 |
/** |
... | ... | |
25 | 28 |
* @author n.hoffmann |
26 | 29 |
* @created Sep 18, 2009 |
27 | 30 |
*/ |
28 |
public class EndnoteImportWizard extends AbstractImportWizard<EndnoteImportConfigurator> implements IImportWizard {
|
|
31 |
public class EndnoteImportWizard extends AbstractImportWizardE4<EndnoteImportConfigurator> {
|
|
29 | 32 |
|
30 | 33 |
private EndnoteImportConfigurator configurator; |
31 | 34 |
|
32 | 35 |
private ImportFromFileDataSourceWizardPage dataSourcePage; |
33 | 36 |
|
37 |
@Inject |
|
38 |
public EndnoteImportWizard(IEclipseContext context, EPartService partService) { |
|
39 |
super(context, partService); |
|
40 |
} |
|
41 |
|
|
34 | 42 |
@Override |
35 | 43 |
public boolean performFinish() { |
36 |
|
|
44 |
|
|
37 | 45 |
File file = dataSourcePage.getFile(); |
38 | 46 |
configurator.setSource(URI.fromFile(file)); |
39 |
|
|
47 |
|
|
40 | 48 |
CdmStore.getImportManager().run(configurator); |
41 |
|
|
49 |
|
|
42 | 50 |
return true; |
43 | 51 |
} |
44 |
|
|
52 |
|
|
45 | 53 |
@Override |
46 | 54 |
public void addPages() { |
47 | 55 |
super.addPages(); |
48 |
|
|
49 |
dataSourcePage = ImportFromFileDataSourceWizardPage.XML();
|
|
56 |
|
|
57 |
dataSourcePage = new ImportFromFileDataSourceWizardPage();
|
|
50 | 58 |
addPage(dataSourcePage); |
51 | 59 |
} |
52 | 60 |
|
53 |
public void init(IWorkbench workbench, IStructuredSelection selection) {
|
|
54 |
super.init(workbench, selection);
|
|
61 |
@Override
|
|
62 |
public void init() {
|
|
55 | 63 |
configurator = CdmStore.getImportManager().EndnoteConfigurator(); |
56 | 64 |
} |
57 | 65 |
|
... | ... | |
59 | 67 |
public EndnoteImportConfigurator getConfigurator() { |
60 | 68 |
return configurator; |
61 | 69 |
} |
70 |
|
|
71 |
|
|
72 |
|
|
62 | 73 |
} |
Also available in: Unified diff
ref #9448: cleanup io package