提交 b44e3157 编写于 作者: S Serge Rider

IDEA project update


Former-commit-id: 55b31ef5
上级 5f16c5c2
...@@ -1007,17 +1007,19 @@ public class ResultSetViewer extends Viewer ...@@ -1007,17 +1007,19 @@ public class ResultSetViewer extends Viewer
@Override @Override
public <T> T getAdapter(Class<T> adapter) public <T> T getAdapter(Class<T> adapter)
{ {
if (UIUtils.hasFocus(filtersPanel)) { if (UIUtils.isUIThread()) {
T result = filtersPanel.getAdapter(adapter); if (UIUtils.hasFocus(filtersPanel)) {
if (result != null) { T result = filtersPanel.getAdapter(adapter);
return result; if (result != null) {
} return result;
} else if (UIUtils.hasFocus(panelFolder)) { }
IResultSetPanel visiblePanel = getVisiblePanel(); } else if (UIUtils.hasFocus(panelFolder)) {
if (visiblePanel instanceof IAdaptable) { IResultSetPanel visiblePanel = getVisiblePanel();
T adapted = ((IAdaptable) visiblePanel).getAdapter(adapter); if (visiblePanel instanceof IAdaptable) {
if (adapted != null) { T adapted = ((IAdaptable) visiblePanel).getAdapter(adapter);
return adapted; if (adapted != null) {
return adapted;
}
} }
} }
} }
......
...@@ -1100,6 +1100,10 @@ public class UIUtils { ...@@ -1100,6 +1100,10 @@ public class UIUtils {
} }
} }
public static boolean isUIThread() {
return Display.getDefault().getThread() == Thread.currentThread();
}
/** /**
* Determine whether this control or any of it's child has focus * Determine whether this control or any of it's child has focus
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册