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
;
15 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
16 import org
.eclipse
.ui
.IWorkbench
;
18 import eu
.etaxonomy
.cdm
.database
.DbSchemaValidation
;
19 import eu
.etaxonomy
.cdm
.io
.jaxb
.JaxbImportConfigurator
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
23 * <p>JaxbImportWizard class.</p>
29 public class JaxbImportWizard
extends AbstractImportWizard
<JaxbImportConfigurator
> {
31 private JaxbImportConfigurator configurator
;
33 private ImportFromFileDataSourceWizardPage dataSourcePage
;
36 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
40 public JaxbImportConfigurator
getConfigurator() {
45 * @see org.eclipse.jface.wizard.Wizard#performFinish()
49 public boolean performFinish() {
50 URI source
= dataSourcePage
.getUri();
51 configurator
.setSource(source
);
52 configurator
.setDbSchemaValidation(DbSchemaValidation
.CREATE
);
54 CdmStore
.getImportManager().run(configurator
);
60 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
63 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
64 super.init(workbench
, selection
);
65 configurator
= CdmStore
.getImportManager().JaxbConfigurator();
69 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#addPages()
73 public void addPages() {
76 dataSourcePage
= new ImportFromFileDataSourceWizardPage("Choose File",
77 "Please choose an XML file in the cdm JAXB format.", new String
[]{"*.xml"});
78 addPage(dataSourcePage
);