提交 6786d6c2 编写于 作者: S serge@jkiss.org

#6488 Connection/schema selector visibility update fixed

上级 adee7090
...@@ -51,14 +51,21 @@ public class DataSourceToolbarUtils ...@@ -51,14 +51,21 @@ public class DataSourceToolbarUtils
MTrimBar topTrim = ((WorkbenchWindow) window).getTopTrim(); MTrimBar topTrim = ((WorkbenchWindow) window).getTopTrim();
for (MTrimElement element : topTrim.getChildren()) { for (MTrimElement element : topTrim.getChildren()) {
if ("dbeaver-connection-selector".equals(element.getElementId())) { if ("dbeaver-connection-selector".equals(element.getElementId())) {
boolean showConnectionSelector = false;
IEditorPart activeEditor = window.getActivePage().getActiveEditor();
if (activeEditor instanceof IDataSourceContainerProvider) {
showConnectionSelector = true;
}
if (element instanceof MElementContainer) { if (element instanceof MElementContainer) {
MElementContainer<? extends MUIElement> container = (MElementContainer<? extends MUIElement>)element; MElementContainer<? extends MUIElement> container = (MElementContainer<? extends MUIElement>)element;
for (MUIElement tbItem : container.getChildren()) { for (MUIElement tbItem : container.getChildren()) {
tbItem.setVisible(false); tbItem.setVisible(!showConnectionSelector);
} tbItem.setVisible(showConnectionSelector);
for (MUIElement tbItem : container.getChildren()) {
tbItem.setVisible(true);
} }
// for (MUIElement tbItem : container.getChildren()) {
// tbItem.setVisible(true);
// }
} }
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册