Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java')
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
index 0635a47bf..caa6aa514 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/widgets/EEFSelectLifecycleManager.java
@@ -221,6 +221,12 @@ public class EEFSelectLifecycleManager extends AbstractEEFWidgetLifecycleManager
// Set combo items
this.controller.onNewCandidates((value) -> {
if (!this.combo.isDisposed()) {
+ if (this.combo.getListVisible() && this.avoidUpdatingOpenedCombo()) {
+ return;
+ }
+ if (this.forceCloseToUpdateCombo()) {
+ this.combo.setListVisible(false);
+ }
if (value != null) {
Object[] candidates = value.toArray();
for (int i = 0; i < candidates.length; i++) {
@@ -240,6 +246,27 @@ public class EEFSelectLifecycleManager extends AbstractEEFWidgetLifecycleManager
}
/**
+ * Needed to workaround https://bugs.eclipse.org/530181, which happens at least under to Windows 7.
+ *
+ * @return true if we should avoid accepting new/updated input while the combo is opened/visible.
+ */
+ private boolean avoidUpdatingOpenedCombo() {
+ // Default to true under Windows 7.
+ boolean win7 = "Windows7".equals(System.getProperty("org.osgi.framework.os.name")); //$NON-NLS-1$ //$NON-NLS-2$
+ return Boolean.valueOf(System.getProperty("org.eclipse.eef.avoidUpdatingOpenedCombo", Boolean.toString(win7))).booleanValue(); //$NON-NLS-1$
+ }
+
+ /**
+ * Checks configuration flag to see if we must close of already opened combos to update their contents (instead of
+ * possibly displaying stale values on OSes that do not support updating opened combos).
+ *
+ * @return true if the combo must be force-closed for its content to be updated.
+ */
+ private boolean forceCloseToUpdateCombo() {
+ return Boolean.valueOf(System.getProperty("org.eclipse.eef.forceCloseToUpdateCombo", Boolean.toString(false))).booleanValue(); //$NON-NLS-1$
+ }
+
+ /**
* {@inheritDoc}
*
* @see org.eclipse.eef.ide.ui.api.widgets.IEEFLifecycleManager#aboutToBeHidden()

Back to the top