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
.sdd
.in
.SDDImportConfigurator
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
23 * <p>SddImportWizard class.</p>
26 * @created Jun 16, 2010
29 public class SddImportWizard
extends AbstractImportWizard
<SDDImportConfigurator
> {
31 private SDDImportConfigurator configurator
;
33 private ImportFromFileDataSourceWizardPage dataSourcePage
;
36 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
40 public SDDImportConfigurator
getConfigurator() {
46 * @see org.eclipse.jface.wizard.Wizard#addPage(org.eclipse.jface.wizard.IWizardPage)
50 public void addPages() {
53 dataSourcePage
= new ImportFromFileDataSourceWizardPage("Choose File",
54 "Please choose an XML file in the SDD format.", new String
[]{"*.xml", "*.sdd"});
55 addPage(dataSourcePage
);
59 * @see org.eclipse.jface.wizard.Wizard#performFinish()
63 public boolean performFinish() {
64 URI source
= dataSourcePage
.getUri();
65 configurator
.setSource(source
);
66 configurator
.setDbSchemaValidation(DbSchemaValidation
.CREATE
);
68 CdmStore
.getImportHandler().run(configurator
);
74 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
77 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
78 configurator
= CdmStore
.getImportHandler().SddConfigurator();