提交 cd1f1d34 编写于 作者: J jurgen

Filter value edit fixed

上级 72e3d27b
......@@ -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;
......
......@@ -83,53 +83,52 @@ public abstract class BaseValueEditor<T extends Control> 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();
}
});
}
});
});
}
});
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册