From 09ca80d64929308933cadb0b776e01f45be8b7e1 Mon Sep 17 00:00:00 2001 From: jurgen Date: Mon, 21 Sep 2015 08:45:35 +0000 Subject: [PATCH] Filter value edit fixed Former-commit-id: cd1f1d34bf91c0eb9f8dbf1633856d42b72ab8fb --- .../resultset/FilterValueEditDialog.java | 1 + .../ui/data/editors/BaseValueEditor.java | 85 +++++++++---------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/FilterValueEditDialog.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/FilterValueEditDialog.java index f134d7ddf1..6aa986e23f 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/FilterValueEditDialog.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/FilterValueEditDialog.java @@ -17,6 +17,7 @@ */ package org.jkiss.dbeaver.ui.controls.resultset; +import org.jkiss.code.Nullable; import org.jkiss.dbeaver.Log; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.swt.SWT; diff --git a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java index 7d069a0cfa..9951a39131 100644 --- a/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java +++ b/plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java @@ -83,53 +83,52 @@ public abstract class BaseValueEditor implements IValueEditor } }); - inlineControl.addTraverseListener(new TraverseListener() { - @Override - public void keyTraversed(TraverseEvent e) - { - if (e.detail == SWT.TRAVERSE_RETURN) { - saveValue(); - e.doit = false; - e.detail = SWT.TRAVERSE_NONE; - } else if (e.detail == SWT.TRAVERSE_ESCAPE) { - valueController.closeInlineEditor(); - e.doit = false; - e.detail = SWT.TRAVERSE_NONE; - } else if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) { - saveValue(); - valueController.nextInlineEditor(e.detail == SWT.TRAVERSE_TAB_NEXT); - e.doit = false; - e.detail = SWT.TRAVERSE_NONE; + if (!UIUtils.isInDialog(inlineControl)) { + inlineControl.addTraverseListener(new TraverseListener() { + @Override + public void keyTraversed(TraverseEvent e) { + if (e.detail == SWT.TRAVERSE_RETURN) { + saveValue(); + e.doit = false; + e.detail = SWT.TRAVERSE_NONE; + } else if (e.detail == SWT.TRAVERSE_ESCAPE) { + valueController.closeInlineEditor(); + e.doit = false; + e.detail = SWT.TRAVERSE_NONE; + } else if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) { + saveValue(); + valueController.nextInlineEditor(e.detail == SWT.TRAVERSE_TAB_NEXT); + e.doit = false; + e.detail = SWT.TRAVERSE_NONE; + } } - } - }); - inlineControl.addFocusListener(new FocusAdapter() { - @Override - public void focusLost(FocusEvent e) - { - // Check new focus control in async mode - // (because right now focus is still on edit control) - inlineControl.getDisplay().asyncExec(new Runnable() { - @Override - public void run() - { - if (inlineControl.isDisposed()) { - return; - } - Control newFocus = inlineControl.getDisplay().getFocusControl(); - if (newFocus != null) { - for (Control fc = newFocus.getParent(); fc != null; fc = fc.getParent()) { - if (fc == valueController.getEditPlaceholder()) { - // New focus is still a child of inline placeholder - do not close it - return; + }); + inlineControl.addFocusListener(new FocusAdapter() { + @Override + public void focusLost(FocusEvent e) { + // Check new focus control in async mode + // (because right now focus is still on edit control) + inlineControl.getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (inlineControl.isDisposed()) { + return; + } + Control newFocus = inlineControl.getDisplay().getFocusControl(); + if (newFocus != null) { + for (Control fc = newFocus.getParent(); fc != null; fc = fc.getParent()) { + if (fc == valueController.getEditPlaceholder()) { + // New focus is still a child of inline placeholder - do not close it + return; + } } } + saveValue(); } - saveValue(); - } - }); - } - }); + }); + } + }); + } } } -- GitLab