Project

General

Profile

Download (1.93 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2017 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9
package eu.etaxonomy.taxeditor.io.e4.out.owl;
10

    
11
import javax.inject.Inject;
12
import javax.inject.Named;
13

    
14
import org.eclipse.e4.core.contexts.IEclipseContext;
15
import org.eclipse.e4.core.di.annotations.Optional;
16
import org.eclipse.e4.ui.services.IServiceConstants;
17
import org.eclipse.jface.viewers.IStructuredSelection;
18

    
19
import eu.etaxonomy.cdm.io.descriptive.owl.out.StructureTreeOwlExportConfigurator;
20
import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4;
21
import eu.etaxonomy.taxeditor.store.CdmStore;
22

    
23
/**
24
 *
25
 * @author pplitzner
26
 * @since May 23, 2019
27
 *
28
 */
29
public class OwlTermExportWizard extends
30
AbstractExportWizardE4<StructureTreeOwlExportConfigurator> {
31

    
32
    private StructureTreeOwlExportConfigurator configurator;
33
    private OwlTermExportWizardPage exportPage;
34

    
35
    @Inject
36
    public OwlTermExportWizard(IEclipseContext context,
37
            @Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection) {
38
        super(context, selection);
39
    }
40

    
41
    @Override
42
    public void init() {
43
        configurator = StructureTreeOwlExportConfigurator.NewInstance();
44
    }
45

    
46
    @Override
47
    public StructureTreeOwlExportConfigurator getConfigurator() {
48
        return configurator;
49
    }
50

    
51
    @Override
52
    public boolean performFinish() {
53
        configurator.setFeatureTrees(exportPage.getSelectedTrees());
54
        configurator.setVocabularyUuids(exportPage.getSelectedVocabularies());
55

    
56
        CdmStore.getExportManager().runMoniteredOperation(configurator, exportPage.getExportDirectory());
57
        return true;
58
    }
59

    
60
    @Override
61
    public void addPages() {
62
        exportPage = new OwlTermExportWizardPage("OWL term export");
63
        addPage(exportPage);
64
    }
65

    
66
}
(3-3/4)