From cb4e0fa1d6c04719c23a1ccdde2b38e857116d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 15 Dec 2021 15:52:34 +0100 Subject: [PATCH 1/2] Reset the combo box only when we have to. --- .../ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java index 2199f94634..21614a4da2 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java @@ -1401,8 +1401,8 @@ private void setSeparationColumnSelection() { if(separationColumn != null) { if(!separationColumns.contains(separationColumn)) { separationColumns.add(0, separationColumn); + comboViewerSeparationColumn.setInput(separationColumns); } - comboViewerSeparationColumn.setInput(separationColumns); comboViewerSeparationColumn.getCombo().select(0); } } From dfabc4e1d031bd6ad8911bfc7ac50716b8cfe0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 15 Dec 2021 15:53:15 +0100 Subject: [PATCH 2/2] Set the combo box initially to the chromatogram's column. --- .../extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java index 21614a4da2..7aa53353af 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/editors/ExtendedChromatogramUI.java @@ -120,6 +120,7 @@ import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.MenuEvent; import org.eclipse.swt.events.MenuListener; @@ -1403,7 +1404,7 @@ private void setSeparationColumnSelection() { separationColumns.add(0, separationColumn); comboViewerSeparationColumn.setInput(separationColumns); } - comboViewerSeparationColumn.getCombo().select(0); + comboViewerSeparationColumn.setSelection(new StructuredSelection(separationColumn)); } } }