From cb45e05b8be0041db0f0c864d7b5b7bf0cbd875a Mon Sep 17 00:00:00 2001 From: Katja Luther Date: Mon, 11 Nov 2019 09:36:43 +0100 Subject: [PATCH] ref #8631: layout issues in abcd import wizard page and refresh of navigator after abcd import --- .../AbcdImportConfiguratorWizardPage.java | 28 ++++++++++++++----- .../taxeditor/model/AbstractUtility.java | 8 ++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java index 2eaf95bf6..d00fc792d 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java @@ -14,6 +14,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.commons.lang.StringUtils; +import org.eclipse.jface.layout.GridLayoutFactory; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; @@ -139,14 +140,19 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i } }); + Composite unitIdComposite = new Composite(composite, SWT.NULL); + GridLayout gridLayoutUnitId = new GridLayout(); + gridLayoutUnitId.numColumns=2; + unitIdComposite.setLayout(gridLayoutUnitId); + GridData gridData = new GridData(); gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false); gridData.horizontalIndent = 5; gridData.minimumWidth = 100; // classificationSelection.setLayoutData(gridData); - Label unitIdLabel = new Label(composite, SWT.NONE); + Label unitIdLabel = new Label(unitIdComposite, SWT.NONE); unitIdLabel.setText(Messages.AbcdImportPreference_map_unit_nr_catalog_number); - checkBoxMapUnitId = new Combo(composite, SWT.BORDER| SWT.READ_ONLY); + checkBoxMapUnitId = new Combo(unitIdComposite, SWT.BORDER| SWT.READ_ONLY); checkBoxMapUnitId.setLayoutData(gridData); checkBoxMapUnitId.add(ACCESSION_NUMBER); checkBoxMapUnitId.add(BARCODE); @@ -163,7 +169,7 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i checkBoxMapUnitId.select(2); } - + GridLayoutFactory.fillDefaults(); Button checkBoxRemoveCountry = new Button(composite, SWT.CHECK); checkBoxRemoveCountry.setSelection(abcdImportConfigurator.isRemoveCountryFromLocalityText()); checkBoxRemoveCountry.setText("Remove country from locality text"); @@ -241,10 +247,14 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i if (!isFileImport){ - Label labelRef = new Label(composite, SWT.NONE); + Composite dnaComposite = new Composite(composite, SWT.NULL); + GridLayout gridLayoutDna = new GridLayout(); + gridLayoutDna.numColumns=2; + dnaComposite.setLayout(gridLayoutDna); + Label labelRef = new Label(dnaComposite, SWT.NONE); labelRef.setText("Biocase provider for associated DNA"); - new Label(composite, SWT.NONE); - textDNAProviderString = new Combo(composite, SWT.BORDER); + new Label(dnaComposite, SWT.NONE); + textDNAProviderString = new Combo(dnaComposite, SWT.BORDER); textDNAProviderString.setLayoutData(gridData); textDNAProviderString.add("Do not search for DNA"); @@ -272,8 +282,12 @@ public class AbcdImportConfiguratorWizardPage extends AbstractPreferenceWizard i // gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false); // gridData.horizontalIndent = 5; // classificationSelection.setLayoutData(gridData); + Composite codeComposite = new Composite(composite, SWT.NULL); - nomenclaturalCodeSelectionCombo = new Combo(composite, SWT.BORDER| SWT.READ_ONLY); + codeComposite.setLayout(gridLayoutUnitId); + Label labelCode = new Label(codeComposite, SWT.NONE); + labelCode.setText("Nomenclatural Code"); + nomenclaturalCodeSelectionCombo = new Combo(codeComposite, SWT.BORDER| SWT.READ_ONLY); nomenclaturalCodeSelectionCombo.setLayoutData(gridData); for(NomenclaturalCode code: NomenclaturalCode.values()){ nomenclaturalCodeSelectionCombo.add(code.getKey()); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java index f0d1a5b72..483cc1991 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java @@ -643,11 +643,19 @@ public abstract class AbstractUtility { // for(String report : remotingMonitor.getResult()) { createResult(label, showResult, remotingMonitor); updateNameEditors(remotingMonitor); + refreshNavigator(); return Status.OK_STATUS; } + private void refreshNavigator() { + EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, true); + + } + + + @Override protected void canceling() { CdmStore.getCurrentApplicationConfiguration().getProgressMonitorService().cancel(uuid); -- 2.34.1