From fd962d94e79dd61676b732a3b0693331f17960f5 Mon Sep 17 00:00:00 2001 From: Laurent Caron Date: Thu, 25 Jan 2024 17:31:59 +0100 Subject: [PATCH] Bug #499 - TableComboViewer dropdown not closed automatically TableComboViewer dropdown not closed automatically on mouse click on the dialog area => this bug is side effect of a Linux-only bug --- .../eclipse/nebula/widgets/tablecombo/TableCombo.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/tablecombo/TableCombo.java b/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/tablecombo/TableCombo.java index 6c0c942a3..2d02634e6 100644 --- a/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/tablecombo/TableCombo.java +++ b/widgets/tablecombo/org.eclipse.nebula.widgets.tablecombo/src/org/eclipse/nebula/widgets/tablecombo/TableCombo.java @@ -584,7 +584,11 @@ private void comboEvent(final Event event) { if (focusControl == arrow || focusControl == table) { return; } - if (!isDropped()) { + if (isDropped()) { + if (isWindows()) { + table.setFocus(); + } + } else { text.setFocus(); } break; @@ -597,6 +601,10 @@ private void comboEvent(final Event event) { } } + private boolean isWindows() { + return System.getProperty("os.name").indexOf("indows") != -1; + } + /** * {@inheritDoc} */