2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The content 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.
9 package eu
.etaxonomy
.taxeditor
.io
.wizard
;
11 import java
.text
.SimpleDateFormat
;
12 import java
.util
.ArrayList
;
13 import java
.util
.Calendar
;
14 import java
.util
.Collections
;
15 import java
.util
.HashSet
;
16 import java
.util
.List
;
18 import java
.util
.UUID
;
20 import org
.eclipse
.jface
.layout
.GridLayoutFactory
;
21 import org
.eclipse
.jface
.wizard
.WizardPage
;
22 import org
.eclipse
.swt
.SWT
;
23 import org
.eclipse
.swt
.events
.SelectionAdapter
;
24 import org
.eclipse
.swt
.events
.SelectionEvent
;
25 import org
.eclipse
.swt
.events
.SelectionListener
;
26 import org
.eclipse
.swt
.layout
.GridData
;
27 import org
.eclipse
.swt
.layout
.GridLayout
;
28 import org
.eclipse
.swt
.widgets
.Button
;
29 import org
.eclipse
.swt
.widgets
.Combo
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.DirectoryDialog
;
32 import org
.eclipse
.swt
.widgets
.Event
;
33 import org
.eclipse
.swt
.widgets
.Label
;
34 import org
.eclipse
.swt
.widgets
.Listener
;
35 import org
.eclipse
.swt
.widgets
.Text
;
37 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationState
;
38 import eu
.etaxonomy
.cdm
.api
.service
.IClassificationService
;
39 import eu
.etaxonomy
.cdm
.filter
.LogicFilter
;
40 import eu
.etaxonomy
.cdm
.io
.cdmLight
.CdmLightExportConfigurator
;
41 import eu
.etaxonomy
.cdm
.io
.coldp
.ColDpExportConfigurator
;
42 import eu
.etaxonomy
.cdm
.io
.common
.ExportConfiguratorBase
;
43 import eu
.etaxonomy
.cdm
.io
.csv
.caryophyllales
.out
.CsvNameExportConfigurator
;
44 import eu
.etaxonomy
.cdm
.io
.csv
.redlist
.demo
.CsvDemoExportConfigurator
;
45 import eu
.etaxonomy
.cdm
.io
.dwca
.out
.DwcaTaxExportConfigurator
;
46 import eu
.etaxonomy
.cdm
.io
.jaxb
.JaxbExportConfigurator
;
47 import eu
.etaxonomy
.cdm
.io
.sdd
.out
.SDDExportConfigurator
;
48 import eu
.etaxonomy
.cdm
.io
.tcsxml
.out
.TcsXmlExportConfigurator
;
49 import eu
.etaxonomy
.cdm
.io
.wfo
.out
.WfoExportConfigurator
;
50 import eu
.etaxonomy
.cdm
.model
.metadata
.PreferencePredicate
;
51 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
52 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
53 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
54 import eu
.etaxonomy
.cdm
.persistence
.dto
.TaxonNodeDtoByNameComparator
;
55 import eu
.etaxonomy
.cdm
.persistence
.dto
.TaxonNodeDtoByRankAndNameComparator
;
56 import eu
.etaxonomy
.cdm
.persistence
.dto
.TaxonNodeDtoNaturalComparator
;
57 import eu
.etaxonomy
.taxeditor
.preference
.NavigatorOrderEnum
;
58 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
59 import eu
.etaxonomy
.taxeditor
.remoting
.source
.ICdmRemoteSource
;
60 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
63 * ExportToFileDestinationWizardPage class.
68 public class ExportToFileDestinationWizardPage
extends WizardPage
implements SelectionListener
{
70 /** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */
71 public static final String DATE_FORMAT_NOW
= "yyyyMMddHHmm";
73 /** Constant <code>JAXB_EXPORT="JAXB_EXPORT"</code> */
74 public static final String JAXB_EXPORT
= "JAXB_EXPORT";
76 /** Constant <code>TCS_EXPORT="TCS_EXPORT"</code> */
77 public static final String TCS_EXPORT
= "TCS_EXPORT";
79 /** Constant <code>SDD_EXPORT="SDD_EXPORT"</code> */
80 public static final String SDD_EXPORT
= "SDD_EXPORT";
82 public static final String DWCA_EXPORT
= "DWCA_EXPORT";
83 public static final String WFO_EXPORT
= "WFO_EXPORT";
84 public static final String CDM_LIGHT_EXPORT
= "CDM_LIGHT(CSV)";
85 public static final String COL_DP_EXPORT
= "COL DP";
86 public static final String CSV_EXPORT
= "CSV_EXPORT";
87 public static final String CSV_NAME_EXPORT
= "CSV_NAME_EXPORT";
88 private static final String CSV_PRINT_EXPORT
= "CSV_PRINT_EXPORT";
89 private static final String EXPORT_FOLDER
= "EXPORT_FOLDER";
90 public static final String XML
= "xml";
92 public static final String CSV
= "csv";
94 public static final String ZIP
= "zip";
96 private boolean csvExport
= false;
98 private boolean csvNameExport
= false;
100 private boolean csvPrintExport
= false;
102 private boolean cdmLightExport
= false;
104 private boolean colDPExport
= false;
105 private boolean dwcaExport
= false;
106 private boolean wfoExport
= false;
108 private DirectoryDialog folderDialog
;
109 private Text text_exportFileName
;
111 private Text text_folder
;
113 private final String type
;
115 private final String extension
;
117 private Combo classificationSelectionCombo
;
119 private List
<Classification
> classifications
;
121 private Classification selectedClassification
;
123 private ExportConfiguratorBase
<?
, ?
, ?
> configurator
;
124 private Button checkUseSelectedTaxonNode
;
126 private Button checkUseSelectedClassification
;
127 private Button checkUseAllClassification
;
129 private Button checkExportUnpublished
;
130 private Button checkExportFactualData
;
131 private Button checkExportUnpublishedFactualData
;
133 private Combo orderSelectionCombo
;
135 private Text text_familyString
;
137 protected ExportToFileDestinationWizardPage(String pageName
, String type
, String title
, String description
,
138 String extension
, ExportConfiguratorBase
<?
, ?
, ?
> configurator
) {
140 this.configurator
= configurator
;
146 case CSV_NAME_EXPORT
:
147 csvNameExport
= true;
149 case CDM_LIGHT_EXPORT
:
150 cdmLightExport
= true;
155 case CSV_PRINT_EXPORT
:
156 csvPrintExport
= true;
165 throw new RuntimeException("Export type not yet handeled: " + type
);
167 this.extension
= extension
;
168 this.setTitle(title
);
169 this.setDescription(description
);
172 public static ExportToFileDestinationWizardPage
Jaxb(JaxbExportConfigurator configurator
) {
173 return new ExportToFileDestinationWizardPage(JAXB_EXPORT
, "jaxb", "JAXB Export",
174 "Exports the content of the currently selected database into the cdm jaxb format.", XML
, configurator
);
177 public static ExportToFileDestinationWizardPage
Tcs(TcsXmlExportConfigurator config
) {
178 return new ExportToFileDestinationWizardPage(TCS_EXPORT
, "tcs", "Tcs Export",
179 "Export the content of the currently selected database into TCS format.", XML
, config
);
182 public static ExportToFileDestinationWizardPage
Sdd(SDDExportConfigurator config
) {
183 return new ExportToFileDestinationWizardPage(SDD_EXPORT
, "sdd", "Sdd Export",
184 "Export the content of the currently selected database into SDD format.", XML
, config
);
187 public static ExportToFileDestinationWizardPage
Dwca(DwcaTaxExportConfigurator config
) {
188 return new ExportToFileDestinationWizardPage(DWCA_EXPORT
, DWCA_EXPORT
, "DwC-Archive Export",
189 "Export the content of the currently selected database into Darwin Core Archive format.", ZIP
, config
);
191 public static ExportToFileDestinationWizardPage
WFO(WfoExportConfigurator config
) {
192 return new ExportToFileDestinationWizardPage(WFO_EXPORT
, WFO_EXPORT
, "WFO Export",
193 "Export the content of the currently selected database into WFO "
197 public static ExportToFileDestinationWizardPage
CdmLight(CdmLightExportConfigurator config
) {
199 return new ExportToFileDestinationWizardPage(CDM_LIGHT_EXPORT
, CDM_LIGHT_EXPORT
, "CDM Light Export (csv)",
200 "Export the content of the currently selected database into the CDM light (csv) format.", CSV
, config
);
203 public static ExportToFileDestinationWizardPage
ColDp(ColDpExportConfigurator config
) {
205 return new ExportToFileDestinationWizardPage(COL_DP_EXPORT
, COL_DP_EXPORT
, "Col DP Export (zip)",
206 "Export the content of the currently selected database into the Catalogue of Life Data Package (Col DP) format.", ZIP
, config
);
209 public static ExportToFileDestinationWizardPage
Csv(CsvDemoExportConfigurator config
) {
211 return new ExportToFileDestinationWizardPage(CSV_EXPORT
, CSV_EXPORT
, "CSV Export",
212 "Export the content of the currently selected database into Comma Separated Value format.", CSV
,
216 public static ExportToFileDestinationWizardPage
CsvNames(CsvNameExportConfigurator config
) {
218 return new ExportToFileDestinationWizardPage(CSV_NAME_EXPORT
, CSV_NAME_EXPORT
, "CSV Name Export",
219 "Export the names of the currently selected database into Semicolon Separated Value format.", CSV
,
223 public static ExportToFileDestinationWizardPage
CsvPrint(CsvNameExportConfigurator config
) {
225 return new ExportToFileDestinationWizardPage(CSV_PRINT_EXPORT
, CSV_NAME_EXPORT
, "CSV Print Export",
226 "Export the content of the currently selected database into Semicolon Separated Value format.", CSV
,
232 public void createControl(Composite parent
) {
234 setPageComplete(false);
236 Composite composite
= new Composite(parent
, SWT
.NONE
);
237 GridLayout gridLayout
= new GridLayout();
239 gridLayout
.numColumns
= 2;
240 TaxonNode node
= null;
242 composite
.setLayout(gridLayout
);
243 if (cdmLightExport
|| dwcaExport
|| colDPExport
) {
244 checkExportUnpublished
= new Button(composite
, SWT
.CHECK
);
245 checkExportUnpublished
.setText("Export unpublished taxa");
246 Label emptyLabel
= new Label(composite
, SWT
.NONE
);
247 checkExportFactualData
= new Button(composite
, SWT
.CHECK
);
248 checkExportFactualData
.setText("Export factual data");
249 checkExportFactualData
.setSelection(true);
250 checkExportFactualData
.addListener(SWT
.Selection
, e
-> {
251 Button b
= (Button
) e
.widget
;
252 GridData data
= (GridData
) checkExportUnpublishedFactualData
.getLayoutData();
253 data
.exclude
= b
.getSelection();
254 checkExportUnpublishedFactualData
.setEnabled(data
.exclude
);
256 if (cdmLightExport
|| colDPExport
) {
257 emptyLabel
= new Label(composite
, SWT
.NONE
);
259 checkExportUnpublishedFactualData
= new Button(composite
, SWT
.CHECK
);
260 checkExportUnpublishedFactualData
.setText("Export unpublished factual data");
261 checkExportUnpublishedFactualData
.setSelection(false);
262 GridData gridData
= new GridData();
263 gridData
.horizontalIndent
= 20;
264 checkExportUnpublishedFactualData
.setLayoutData(gridData
);
267 @SuppressWarnings("unused")
268 Label nope
= new Label(composite
, SWT
.NONE
);
270 Label separator
= new Label(composite
, SWT
.HORIZONTAL
| SWT
.SEPARATOR
);
271 GridData gridDataSep
= new GridData(GridData
.FILL_HORIZONTAL
);
272 gridDataSep
.horizontalSpan
= 2;
273 separator
.setLayoutData(gridDataSep
);
275 if (classifications
== null) {
276 classifications
= CdmStore
.getService(IClassificationService
.class).list(null, null, null, null, null);
277 Collections
.sort(classifications
, (o1
, o2
) -> {
281 int result
= o1
.getTitleCache().compareTo(o2
.getTitleCache());
283 return o1
.getUuid().compareTo(o2
.getUuid());
287 if (!configurator
.getTaxonNodeFilter().getClassificationFilter().isEmpty()) {
288 selectedClassification
= CdmStore
.getService(IClassificationService
.class)
289 .load(configurator
.getTaxonNodeFilter().getClassificationFilter().get(0).getUuid());
292 selectedClassification
= classifications
.iterator().next();
296 if (csvExport
|| csvPrintExport
|| cdmLightExport
|| csvNameExport
|| dwcaExport
|| colDPExport
|| wfoExport
) {
298 // Label comboBoxLabel = new Label(composite, SWT.NONE);
299 // comboBoxLabel.setText("Classification");
300 Composite selectNodeOrClassification
= new Composite(composite
, SWT
.NONE
);
301 GridLayout grid
= new GridLayout();
303 selectNodeOrClassification
.setLayout(grid
);
304 if ((cdmLightExport
|| dwcaExport
|| colDPExport
|| wfoExport
) && !configurator
.getTaxonNodeFilter().getSubtreeFilter().isEmpty()) {
306 checkUseSelectedTaxonNode
= new Button(selectNodeOrClassification
, SWT
.RADIO
);
308 String taxonStr
= "";
309 int count
= configurator
.getTaxonNodeFilter().getSubtreeFilter().size();
310 List
<TaxonNode
> selectedNodes
= new ArrayList
<>();
311 for (LogicFilter
<TaxonNode
> filter
: configurator
.getTaxonNodeFilter().getSubtreeFilter()) {
312 node
= CdmApplicationState
.getCurrentAppConfig().getTaxonNodeService().load(filter
.getUuid());
313 selectedNodes
.add(node
);
315 if (node
.hasTaxon()) {
316 taxonStr
+= node
.getTaxon().getName().getTitleCache();
323 checkUseSelectedTaxonNode
.setText("Export all selected subtree(s) (" + taxonStr
+ ")");
324 checkUseSelectedTaxonNode
.addListener(SWT
.Selection
, e
-> {
325 Button b
= (Button
) e
.widget
;
326 GridData data
= (GridData
) classificationSelectionCombo
.getLayoutData();
327 data
.exclude
= b
.getSelection();
328 if (classificationSelectionCombo
!= null) {
329 classificationSelectionCombo
.setEnabled(!data
.exclude
);
332 checkUseSelectedTaxonNode
.setSelection(true);
334 Composite wfoComp
= new Composite(selectNodeOrClassification
, SWT
.NONE
);
335 grid
= new GridLayout();
337 wfoComp
.setLayout(grid
);
339 Label label
= new Label(wfoComp
, SWT
.NONE
);
340 label
.setText("Export all selected subtree(s) (" + taxonStr
+ ")");
341 GridData gridData
= new GridData();
342 gridData
.horizontalSpan
= 2;
343 gridData
.grabExcessHorizontalSpace
= true;
344 label
.setLayoutData(gridData
);
346 Label familyString
= new Label(wfoComp
, SWT
.NONE
);
347 familyString
.setText("Family");
348 text_familyString
= new Text(wfoComp
, SWT
.BORDER
);
349 text_familyString
.setText(generateFamilyName(selectedNodes
));
350 text_familyString
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false));
355 if (cdmLightExport
|| dwcaExport
|| colDPExport
) {
357 checkUseAllClassification
= new Button(selectNodeOrClassification
, SWT
.RADIO
);
358 checkUseAllClassification
.setText("Export all classifications");
359 checkUseAllClassification
.addListener(SWT
.Selection
, new Listener() {
361 public void handleEvent(Event e
) {
362 Button b
= (Button
) e
.widget
;
363 GridData data
= (GridData
) classificationSelectionCombo
.getLayoutData();
364 data
.exclude
= b
.getSelection();
365 classificationSelectionCombo
.setEnabled(!data
.exclude
);
370 checkUseSelectedClassification
= new Button(selectNodeOrClassification
, SWT
.RADIO
);
371 checkUseSelectedClassification
.setText("Export selected classification");
372 checkUseSelectedClassification
.addListener(SWT
.Selection
, e
-> {
373 Button b
= (Button
) e
.widget
;
374 GridData data
= (GridData
) classificationSelectionCombo
.getLayoutData();
375 data
.exclude
= b
.getSelection();
376 classificationSelectionCombo
.setEnabled(data
.exclude
);
381 selectedClassification
= node
.getClassification();
384 createClassificationSelectionCombo(selectNodeOrClassification
);
386 if (cdmLightExport
) {
387 Label separator
= new Label(composite
, SWT
.HORIZONTAL
| SWT
.SEPARATOR
);
388 GridData gridDataSep
= new GridData();
389 gridDataSep
= new GridData(GridData
.BEGINNING
, GridData
.CENTER
, true, true);
390 gridDataSep
.horizontalSpan
= 2;
391 separator
.setLayoutData(gridDataSep
);
393 Composite comp
= new Composite(composite
, SWT
.NONE
);
395 GridData gridData
= new GridData();
396 gridData
= new GridData(GridData
.BEGINNING
, GridData
.CENTER
, true, false);
397 gridData
.horizontalSpan
= 2;
398 comp
.setLayoutData(gridData
);
400 Label label
= new Label(comp
, SWT
.NONE
);
401 label
.setText("Sorting of taxa");
403 orderSelectionCombo
= new Combo(comp
, SWT
.BORDER
| SWT
.READ_ONLY
);
405 GridLayoutFactory
.fillDefaults().applyTo(comp
);
406 for (NavigatorOrderEnum display
: NavigatorOrderEnum
.values()) {
407 orderSelectionCombo
.add(display
.getLabel());
411 if (PreferencesUtil
.getStringValue(PreferencePredicate
.TaxonNodeOrder
.getKey()) != null) {
412 NavigatorOrderEnum orderInNavigator
= NavigatorOrderEnum
413 .valueOf(PreferencesUtil
.getStringValue(PreferencePredicate
.TaxonNodeOrder
.getKey()));
415 for (String itemLabel
: orderSelectionCombo
.getItems()) {
416 if (itemLabel
.equalsIgnoreCase(orderInNavigator
.getLabel())) {
417 orderSelectionCombo
.select(index
);
418 setComparatorToConfig();
425 orderSelectionCombo
.addSelectionListener(new SelectionListener() {
428 public void widgetSelected(SelectionEvent e
) {
429 setComparatorToConfig();
433 public void widgetDefaultSelected(SelectionEvent e
) {
434 // TODO Auto-generated method stub
439 if (classificationSelectionCombo
!= null) {
440 if (checkUseSelectedTaxonNode
!= null) {
441 if (checkUseSelectedTaxonNode
.getSelection()) {
442 classificationSelectionCombo
.setEnabled(false);
445 classificationSelectionCombo
.setEnabled(true);
446 classificationSelectionCombo
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 2, 1));
449 Label separator
= new Label(composite
, SWT
.HORIZONTAL
| SWT
.SEPARATOR
);
450 GridData gridData
= new GridData(GridData
.FILL_HORIZONTAL
);
451 gridData
.horizontalSpan
= 2;
452 separator
.setLayoutData(gridData
);
456 Label folderLabel
= new Label(composite
, SWT
.NONE
);
457 folderLabel
.setText("Select Folder for exported files");
458 folderLabel
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 2, 1));
459 folderDialog
= new DirectoryDialog(parent
.getShell());
460 String exportFolder
= PreferencesUtil
.getStringValue(EXPORT_FOLDER
, true);
461 folderDialog
.setFilterPath(exportFolder
);
463 text_folder
= new Text(composite
, SWT
.BORDER
);
464 text_folder
.setEditable(false);
465 text_folder
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false));
466 if (exportFolder
!= null) {
467 text_folder
.setText(exportFolder
);
468 setPageComplete(true);
471 Button button
= new Button(composite
, SWT
.PUSH
);
472 button
.setText("Browse...");
474 button
.addSelectionListener(new SelectionAdapter() {
476 public void widgetSelected(SelectionEvent e
) {
477 super.widgetSelected(e
);
479 String path
= folderDialog
.open();
480 if (path
!= null) { // a folder was selected
481 text_folder
.setText(path
);
482 PreferencesUtil
.setStringValue(EXPORT_FOLDER
, path
);
483 setPageComplete(true);
487 if (!cdmLightExport
) {
489 Label fileLabel
= new Label(composite
, SWT
.NONE
);
490 fileLabel
.setText("Filename");
491 text_exportFileName
= new Text(composite
, SWT
.BORDER
);
492 text_exportFileName
.setText(generateFilename());
493 text_exportFileName
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false));
496 // make the composite the wizard pages control
497 setControl(composite
);
503 private String
generateFamilyName(List
<TaxonNode
> nodes
) {
504 if (nodes
.size() == 1){
505 TaxonNode node
= nodes
.get(0);
506 if (node
.getTaxon() != null) {
507 if(node
.getTaxon().getName().getRank().getOrderIndex() >= Rank
.FAMILY().getOrderIndex()) {
508 TaxonNode familyNode
= node
.getAncestorOfRank(Rank
.FAMILY());
509 if (familyNode
!= null && familyNode
.getTaxon() != null) {
510 return familyNode
.getTaxon().getName().getNameCache();
520 protected void setComparatorToConfig() {
521 if (orderSelectionCombo
.getText().equals(NavigatorOrderEnum
.NaturalOrder
.getLabel())) {
522 ((CdmLightExportConfigurator
) configurator
).setTaxonNodeComparator(new TaxonNodeDtoNaturalComparator());
523 } else if (orderSelectionCombo
.getText().equals(NavigatorOrderEnum
.AlphabeticalOrder
.getLabel())) {
524 ((CdmLightExportConfigurator
) configurator
).setTaxonNodeComparator(new TaxonNodeDtoByNameComparator());
526 ((CdmLightExportConfigurator
) configurator
)
527 .setTaxonNodeComparator(new TaxonNodeDtoByRankAndNameComparator());
531 protected String
generateFilename() {
532 StringBuffer buffer
= new StringBuffer();
534 Calendar cal
= Calendar
.getInstance();
535 SimpleDateFormat sdf
= new SimpleDateFormat(DATE_FORMAT_NOW
);
536 buffer
.append(sdf
.format(cal
.getTime()));
539 buffer
.append(type
+ "_");
541 String source
= ((ICdmRemoteSource
) CdmStore
.getActiveCdmSource()).toString();
542 source
= source
.substring(source
.indexOf("/") + 1);
543 buffer
.append(source
);
546 buffer
.append(extension
);
548 return buffer
.toString();
551 public String
getExportFileName() {
552 return text_exportFileName
.getText();
556 * @return the familyString
558 public String
getFamilyString() {
559 return text_familyString
.getText();
562 public String
getFolderText() {
563 return text_folder
.getText();
566 public Text
getFolderComposite() {
570 public boolean isExportUnpublishedData() {
571 return checkExportUnpublished
.getSelection();
574 public boolean isExportFactualData() {
575 return checkExportFactualData
.getSelection();
578 public boolean isExportUnpublishedFactualData() {
579 return checkExportUnpublishedFactualData
.getSelection();
582 private void createClassificationSelectionCombo(Composite parent
) {
584 GridData gridData
= new GridData();
585 gridData
= new GridData(GridData
.BEGINNING
, GridData
.CENTER
, true, false);
586 gridData
.horizontalIndent
= 5;
588 classificationSelectionCombo
= new Combo(parent
, SWT
.BORDER
| SWT
.READ_ONLY
);
589 classificationSelectionCombo
.setLayoutData(gridData
);
590 for (Classification tree
: classifications
) {
591 classificationSelectionCombo
.add(tree
.getTitleCache(), classifications
.indexOf(tree
));
594 classificationSelectionCombo
.select(classifications
.indexOf(selectedClassification
));
596 // TODO remember last selection
597 classificationSelectionCombo
.addSelectionListener(this);
601 public Combo
getCombo() {
602 return classificationSelectionCombo
;
606 public void widgetSelected(SelectionEvent e
) {
607 selectedClassification
= classifications
.get(classificationSelectionCombo
.getSelectionIndex());
610 public Classification
getSelectedClassification() {
611 return selectedClassification
;
615 public void widgetDefaultSelected(SelectionEvent e
) {
619 public UUID
getSelectedClassificationUUID() {
620 return selectedClassification
.getUuid();
623 public boolean getCheckUseSelectedTaxonNode() {
624 if (checkUseSelectedTaxonNode
== null) {
627 return checkUseSelectedTaxonNode
.getSelection();
630 public boolean getCheckUseAllClassifications() {
631 if (checkUseAllClassification
== null) {
634 return checkUseAllClassification
.getSelection();
637 public Set
<UUID
> getAllClassificationUuids() {
638 Set
<UUID
> allClassificationUuids
= new HashSet
<>();
639 for (Classification classification
: this.classifications
) {
640 allClassificationUuids
.add(classification
.getUuid());
642 return allClassificationUuids
;
646 public boolean canFlipToNextPage() {
647 return getFolderText() != null;