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
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
15 import org
.eclipse
.core
.runtime
.IStatus
;
16 import org
.eclipse
.core
.runtime
.Status
;
17 import org
.eclipse
.core
.runtime
.jobs
.Job
;
18 import org
.eclipse
.jface
.wizard
.Wizard
;
19 import org
.eclipse
.ui
.IExportWizard
;
21 import eu
.etaxonomy
.cdm
.io
.common
.CdmDefaultExport
;
22 import eu
.etaxonomy
.cdm
.io
.common
.IExportConfigurator
;
23 import eu
.etaxonomy
.cdm
.io
.common
.IIoConfigurator
;
30 public abstract class AbstractExportWizard
<CONFIG
extends IIoConfigurator
> extends Wizard
implements IExportWizard
{
31 private static final Logger logger
= Logger
32 .getLogger(AbstractExportWizard
.class);
34 protected final String CONFIGURATION_PAGE
= "CONFIGURATION_PAGE";
36 private GenericConfiguratorWizardPage pageConfiguration
;
38 private CdmDefaultExport export
;
40 public boolean doExport(final IExportConfigurator configurator
){
41 export
= new CdmDefaultExport();
43 Job exportJob
= new Job("Export"){
45 protected IStatus
run(IProgressMonitor monitor
) {
46 return export
.invoke(configurator
) ? Status
.OK_STATUS
: Status
.CANCEL_STATUS
;
56 * @see org.eclipse.jface.wizard.Wizard#addPages()
59 public void addPages() {
62 pageConfiguration
= GenericConfiguratorWizardPage
.Export(CONFIGURATION_PAGE
, getConfigurator());
63 this.addPage(pageConfiguration
);
66 public abstract CONFIG
getConfigurator();