Revision 1e816532
Added by Katja Luther almost 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/csv/name/CsvNameExportWizardE4.java | ||
---|---|---|
12 | 12 |
import java.io.File; |
13 | 13 |
|
14 | 14 |
import javax.inject.Inject; |
15 |
import javax.inject.Named; |
|
15 | 16 |
|
16 | 17 |
import org.eclipse.core.runtime.jobs.Job; |
17 | 18 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
19 |
import org.eclipse.e4.core.di.annotations.Optional; |
|
20 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
21 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
22 |
import org.eclipse.jface.viewers.TreeSelection; |
|
18 | 23 |
import org.eclipse.swt.widgets.Combo; |
19 | 24 |
import org.eclipse.ui.progress.IProgressConstants; |
20 | 25 |
|
21 | 26 |
import eu.etaxonomy.cdm.io.csv.caryophyllales.out.CsvNameExportConfigurator; |
27 |
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto; |
|
22 | 28 |
import eu.etaxonomy.taxeditor.io.e4.out.AbstractExportWizardE4; |
23 | 29 |
import eu.etaxonomy.taxeditor.io.wizard.ExportToFileDestinationWizardPage; |
24 | 30 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
... | ... | |
35 | 41 |
protected ExportToFileDestinationWizardPage page; |
36 | 42 |
|
37 | 43 |
@Inject |
38 |
public CsvNameExportWizardE4(IEclipseContext context) { |
|
39 |
super(context); |
|
44 |
public CsvNameExportWizardE4(IEclipseContext context, |
|
45 |
@Optional@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection) { |
|
46 |
super(context, selection); |
|
40 | 47 |
} |
41 | 48 |
|
42 | 49 |
@Override |
43 | 50 |
public void init() { |
44 | 51 |
configurator = CsvNameExportConfigurator.NewInstance(null,null); |
45 | 52 |
configurator.setNamesOnly(true); |
53 |
if (selection instanceof TreeSelection && !selection.isEmpty()){ |
|
54 |
TaxonNodeDto node = (TaxonNodeDto)selection.getFirstElement(); |
|
55 |
configurator.setClassificationUUID(node.getClassificationUUID()); |
|
56 |
} |
|
46 | 57 |
} |
47 | 58 |
|
48 | 59 |
@Override |
Also available in: Unified diff
smaller changes in io wizards and navigator menu