From 4b73cbacd9c88a5118065a94f4e6842dbb3d5fbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20M=C3=BCller?= Date: Fri, 7 Jul 2023 14:33:25 +0200 Subject: [PATCH] cleanup --- .../ExportToFileDestinationWizardPage.java | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java index 9f0999fd3..0a66dbcf8 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExportToFileDestinationWizardPage.java @@ -6,7 +6,6 @@ * The content of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ - package eu.etaxonomy.taxeditor.io.wizard; import java.text.SimpleDateFormat; @@ -112,21 +111,20 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel private Classification selectedClassification; - private Label classificationLabel; - - private ExportConfiguratorBase configurator; - private Button checkUseSelectedtaxonNode; + private ExportConfiguratorBase configurator; + private Button checkUseSelectedTaxonNode; private Button checkUseSelectedClassification; private Button checkUseAllClassification; private Button checkExportUnpublished; private Button checkExportFactualData; - Combo orderSelectionCombo; + + private Combo orderSelectionCombo; protected ExportToFileDestinationWizardPage(String pageName, String type, - String title, String description, String extension, ExportConfiguratorBase configurator) { + String title, String description, String extension, ExportConfiguratorBase configurator) { super(pageName); this.configurator = configurator; this.type = type; @@ -146,6 +144,8 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel case DWCA_EXPORT: dwcaExport = true; break; + default: + throw new RuntimeException("Export type not yet handeled: " + type); } this.extension = extension; this.setTitle(title); @@ -247,6 +247,7 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel checkExportFactualData = new Button(composite, SWT.CHECK); checkExportFactualData.setText("Export factual data"); checkExportFactualData.setSelection(true); + @SuppressWarnings("unused") Label nope = new Label(composite, SWT.NONE); @@ -275,7 +276,6 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel } } - if(csvExport || csvPrintExport || cdmLightExport|| csvNameExport || dwcaExport){ // Label comboBoxLabel = new Label(composite, SWT.NONE); @@ -285,7 +285,7 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel grid.numColumns = 1; selectNodeOrClassification.setLayout(grid); if ((cdmLightExport || dwcaExport)&& !configurator.getTaxonNodeFilter().getSubtreeFilter().isEmpty()){ - checkUseSelectedtaxonNode= new Button(selectNodeOrClassification, SWT.RADIO); + checkUseSelectedTaxonNode= new Button(selectNodeOrClassification, SWT.RADIO); String taxonStr = ""; int count = configurator.getTaxonNodeFilter().getSubtreeFilter().size(); for (LogicFilter filter: configurator.getTaxonNodeFilter().getSubtreeFilter()){ @@ -299,18 +299,14 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel } } - checkUseSelectedtaxonNode.setText("Export selected subtree(s) ("+ taxonStr+")"); - checkUseSelectedtaxonNode.addListener(SWT.Selection, new Listener() { - @Override - public void handleEvent(Event e) { + checkUseSelectedTaxonNode.setText("Export selected subtree(s) ("+ taxonStr+")"); + checkUseSelectedTaxonNode.addListener(SWT.Selection, e->{ Button b = (Button) e.widget; GridData data = (GridData) classificationSelectionCombo.getLayoutData(); data.exclude = b.getSelection(); classificationSelectionCombo.setEnabled(!data.exclude); - - } }); - checkUseSelectedtaxonNode.setSelection(true); + checkUseSelectedTaxonNode.setSelection(true); } if(cdmLightExport || dwcaExport){ if (dwcaExport){ @@ -329,16 +325,12 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel } checkUseSelectedClassification= new Button(selectNodeOrClassification, SWT.RADIO); checkUseSelectedClassification.setText("Export selected classification"); - checkUseSelectedClassification.addListener(SWT.Selection, new Listener() { - @Override - public void handleEvent(Event e) { + checkUseSelectedClassification.addListener(SWT.Selection, e->{ Button b = (Button) e.widget; GridData data = (GridData) classificationSelectionCombo.getLayoutData(); data.exclude = b.getSelection(); classificationSelectionCombo.setEnabled(data.exclude); - - } - }); + }); } if (node!= null){ @@ -397,8 +389,8 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel }); } - if (checkUseSelectedtaxonNode != null){ - if (checkUseSelectedtaxonNode.getSelection()){ + if (checkUseSelectedTaxonNode != null){ + if (checkUseSelectedTaxonNode.getSelection()){ classificationSelectionCombo.setEnabled(false); } }else{ @@ -559,10 +551,10 @@ public class ExportToFileDestinationWizardPage extends WizardPage implements Sel } public boolean getCheckUseSelectedTaxonNode() { - if (checkUseSelectedtaxonNode== null){ + if (checkUseSelectedTaxonNode== null){ return false; } - return checkUseSelectedtaxonNode.getSelection(); + return checkUseSelectedTaxonNode.getSelection(); } public boolean getCheckUseAllClassifications() { if (checkUseAllClassification== null){ -- 2.34.1