Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
e6e70d0b
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6e70d0b
编写于
12月 28, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
DS toolbar styling fix
Former-commit-id:
3a93bb6c
上级
616750e8
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
19 addition
and
5 deletion
+19
-5
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceToolbarUtils.java
...dbeaver/ui/actions/datasource/DataSourceToolbarUtils.java
+19
-5
未找到文件。
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceToolbarUtils.java
浏览文件 @
e6e70d0b
...
...
@@ -20,7 +20,9 @@ import org.eclipse.e4.ui.model.application.ui.MElementContainer;
import
org.eclipse.e4.ui.model.application.ui.MUIElement
;
import
org.eclipse.e4.ui.model.application.ui.basic.MTrimBar
;
import
org.eclipse.e4.ui.model.application.ui.basic.MTrimElement
;
import
org.eclipse.swt.graphics.Color
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.ui.IEditorPart
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.eclipse.ui.PlatformUI
;
...
...
@@ -33,6 +35,8 @@ import org.jkiss.dbeaver.ui.UIUtils;
public
class
DataSourceToolbarUtils
{
public
static
final
String
CONNECTION_SELECTOR_TOOLBAR_ID
=
"dbeaver-connection-selector"
;
public
static
DBPDataSourceContainer
getCurrentDataSource
(
IWorkbenchWindow
workbenchWindow
)
{
if
(
workbenchWindow
==
null
||
workbenchWindow
.
getActivePage
()
==
null
)
{
return
null
;
...
...
@@ -52,7 +56,7 @@ public class DataSourceToolbarUtils
if
(
window
instanceof
WorkbenchWindow
)
{
MTrimBar
topTrim
=
((
WorkbenchWindow
)
window
).
getTopTrim
();
for
(
MTrimElement
element
:
topTrim
.
getChildren
())
{
if
(
"dbeaver-connection-selector"
.
equals
(
element
.
getElementId
()))
{
if
(
CONNECTION_SELECTOR_TOOLBAR_ID
.
equals
(
element
.
getElementId
()))
{
boolean
showConnectionSelector
=
false
;
IEditorPart
activeEditor
=
window
.
getActivePage
().
getActiveEditor
();
DBPDataSourceContainer
dataSourceContainer
=
null
;
...
...
@@ -65,10 +69,20 @@ public class DataSourceToolbarUtils
Object
widget
=
element
.
getWidget
();
if
(
widget
instanceof
Composite
)
{
Composite
controlsPanel
=
(
Composite
)
widget
;
if
(
dataSourceContainer
==
null
)
{
controlsPanel
.
setBackground
(
null
);
}
else
{
controlsPanel
.
setBackground
(
UIUtils
.
getConnectionTypeColor
(
dataSourceContainer
.
getConnectionConfiguration
().
getConnectionType
()));
Color
bgColor
=
dataSourceContainer
==
null
?
null
:
UIUtils
.
getConnectionTypeColor
(
dataSourceContainer
.
getConnectionConfiguration
().
getConnectionType
());
Control
[]
childControl
=
controlsPanel
.
getChildren
();
for
(
Control
cc
:
childControl
)
{
// if (bgColor != null) {
// Color oldBackground = cc.getBackground();
// if (oldBackground != null) {
// RGB newBackground = UIUtils.blend(oldBackground.getRGB(), bgColor.getRGB(), 50);
// cc.setBackground(UIUtils.getSharedColor(newBackground));
// continue;
// }
// }
cc
.
setBackground
(
bgColor
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录