Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
3ae69090
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
3ae69090
编写于
4月 28, 2020
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#8366 Default connection types for light/dark themes
Former-commit-id:
1b385edb
上级
2457bfea
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
50 addition
and
15 deletion
+50
-15
plugins/org.jkiss.dbeaver.core/OSGI-INF/l10n/bundle.properties
...ns/org.jkiss.dbeaver.core/OSGI-INF/l10n/bundle.properties
+4
-2
plugins/org.jkiss.dbeaver.core/css/e4-dark_dbeaver_prefstyle.css
.../org.jkiss.dbeaver.core/css/e4-dark_dbeaver_prefstyle.css
+4
-0
plugins/org.jkiss.dbeaver.core/plugin.xml
plugins/org.jkiss.dbeaver.core/plugin.xml
+20
-0
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPConnectionType.java
...org/jkiss/dbeaver/model/connection/DBPConnectionType.java
+2
-2
plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java
...rg.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java
+20
-11
未找到文件。
plugins/org.jkiss.dbeaver.core/OSGI-INF/l10n/bundle.properties
浏览文件 @
3ae69090
...
...
@@ -111,8 +111,10 @@ page.org.jkiss.dbeaver.preferences.main.qm.name = Query Manager
page.org.jkiss.dbeaver.preferences.connectionTypes.name
=
Connection Types
page.org.jkiss.dbeaver.project.settings.networkProfiles.name
=
Network Profiles
themeElementCategory.org.jkiss.dbeaver.ui.presentation.txn.label
=
Transactions
themeElementCategory.org.jkiss.dbeaver.ui.presentation.txn.description
=
Transactions colors
themeElementCategory.org.jkiss.dbeaver.ui.presentation.txn.label
=
Database Transactions
themeElementCategory.org.jkiss.dbeaver.ui.presentation.txn.description
=
Database transaction state colors
themeElementCategory.org.jkiss.dbeaver.ui.presentation.colors.connectionTypes.label
=
Database connection types
themeElementCategory.org.jkiss.dbeaver.ui.presentation.colors.connectionTypes.description
=
Colors for predefined connection types
colorDefinition.org.jkiss.dbeaver.txn.color.committed.background.label
=
Committed transaction
colorDefinition.org.jkiss.dbeaver.txn.color.committed.background.description
=
Committed transaction background
...
...
plugins/org.jkiss.dbeaver.core/css/e4-dark_dbeaver_prefstyle.css
浏览文件 @
3ae69090
...
...
@@ -50,4 +50,8 @@
'org.jkiss.dbeaver.hex.editor.color.caret=80,80,80'
'org.jkiss.dbeaver.hex.editor.color.text=255,255,255'
'org.jkiss.dbeaver.color.connectionType.qa.background=0,115,0'
'org.jkiss.dbeaver.color.connectionType.prod.background=140,0,0'
}
plugins/org.jkiss.dbeaver.core/plugin.xml
浏览文件 @
3ae69090
...
...
@@ -1076,6 +1076,26 @@
<description>
%colorDefinition.org.jkiss.dbeaver.txn.color.transaction.background.description
</description>
</colorDefinition>
<!-- Colors for connection types -->
<themeElementCategory
label=
"%themeElementCategory.org.jkiss.dbeaver.ui.presentation.colors.connectionTypes.label"
id=
"org.jkiss.dbeaver.ui.presentation.colors.connectionTypes"
>
<description>
%themeElementCategory.org.jkiss.dbeaver.ui.presentation.colors.connectionTypes.description
</description>
</themeElementCategory>
<colorDefinition
label=
"Test"
categoryId=
"org.jkiss.dbeaver.ui.presentation.colors.connectionTypes"
id=
"org.jkiss.dbeaver.color.connectionType.qa.background"
value=
"196,255,181"
>
<description>
QA/Test/Stage server
</description>
</colorDefinition>
<colorDefinition
label=
"Production"
categoryId=
"org.jkiss.dbeaver.ui.presentation.colors.connectionTypes"
id=
"org.jkiss.dbeaver.color.connectionType.prod.background"
value=
"247,159,129"
>
<description>
Production server
</description>
</colorDefinition>
</extension>
<extension
point=
"org.eclipse.ui.exportWizards"
>
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPConnectionType.java
浏览文件 @
3ae69090
...
...
@@ -17,8 +17,8 @@ import java.util.List;
public
class
DBPConnectionType
implements
DBPDataSourcePermissionOwner
{
public
static
final
DBPConnectionType
DEV
=
new
DBPConnectionType
(
"dev"
,
ModelMessages
.
dbp_connection_type_table_development
,
"255,255,255"
,
ModelMessages
.
dbp_connection_type_table_regular_development_database
,
true
,
false
,
false
,
true
,
null
);
//$NON-NLS-1$ //$NON-NLS-3$
public
static
final
DBPConnectionType
TEST
=
new
DBPConnectionType
(
"test"
,
ModelMessages
.
dbp_connection_type_table_test
,
"
196,255,181
"
,
ModelMessages
.
dbp_connection_type_table_test_database
,
true
,
false
,
true
,
true
,
null
);
//$NON-NLS-1$ //$NON-NLS-3$
public
static
final
DBPConnectionType
PROD
=
new
DBPConnectionType
(
"prod"
,
ModelMessages
.
dbp_connection_type_table_production
,
"
247,159,129
"
,
ModelMessages
.
dbp_connection_type_table_production_database
,
false
,
true
,
true
,
true
,
null
);
//$NON-NLS-1$ //$NON-NLS-3$
public
static
final
DBPConnectionType
TEST
=
new
DBPConnectionType
(
"test"
,
ModelMessages
.
dbp_connection_type_table_test
,
"
org.jkiss.dbeaver.color.connectionType.qa.background
"
,
ModelMessages
.
dbp_connection_type_table_test_database
,
true
,
false
,
true
,
true
,
null
);
//$NON-NLS-1$ //$NON-NLS-3$
public
static
final
DBPConnectionType
PROD
=
new
DBPConnectionType
(
"prod"
,
ModelMessages
.
dbp_connection_type_table_production
,
"
org.jkiss.dbeaver.color.connectionType.prod.background
"
,
ModelMessages
.
dbp_connection_type_table_production_database
,
false
,
true
,
true
,
true
,
null
);
//$NON-NLS-1$ //$NON-NLS-3$
public
static
final
DBPConnectionType
[]
SYSTEM_TYPES
=
{
DEV
,
TEST
,
PROD
};
public
static
final
DBPConnectionType
DEFAULT_TYPE
=
DEV
;
...
...
plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java
浏览文件 @
3ae69090
...
...
@@ -1793,25 +1793,34 @@ public class UIUtils {
if
(
CommonUtils
.
isEmpty
(
rgbString
))
{
return
null
;
}
return
getColorByRGB
(
rgbString
);
return
getCo
nnectionCo
lorByRGB
(
rgbString
);
}
public
static
Color
getColorByRGB
(
String
rgbString
)
{
Color
connectionColor
=
sharedTextColors
.
getColor
(
rgbString
);
if
(
connectionColor
.
getBlue
()
==
255
&&
connectionColor
.
getRed
()
==
255
&&
connectionColor
.
getGreen
()
==
255
)
{
// For white color return just null to avoid explicit color set.
// It is important for dark themes
public
static
Color
getConnectionTypeColor
(
DBPConnectionType
connectionType
)
{
String
rgbString
=
connectionType
.
getColor
();
if
(
CommonUtils
.
isEmpty
(
rgbString
))
{
return
null
;
}
return
connectionColor
;
return
getConnectionColorByRGB
(
rgbString
)
;
}
public
static
Color
getConnectionTypeColor
(
DBPConnectionType
connectionType
)
{
String
rgbString
=
connectionType
.
getColor
();
if
(
CommonUtils
.
isEmpty
(
rgbString
))
{
public
static
Color
getConnectionColorByRGB
(
String
rgbStringOrId
)
{
if
(
rgbStringOrId
.
isEmpty
())
{
return
null
;
}
return
getColorByRGB
(
rgbString
);
if
(
Character
.
isAlphabetic
(
rgbStringOrId
.
charAt
(
0
)))
{
// Some color constant
RGB
rgb
=
getActiveWorkbenchWindow
().
getWorkbench
().
getThemeManager
().
getCurrentTheme
().
getColorRegistry
().
getRGB
(
rgbStringOrId
);
return
sharedTextColors
.
getColor
(
rgb
);
}
else
{
Color
connectionColor
=
sharedTextColors
.
getColor
(
rgbStringOrId
);
if
(
connectionColor
.
getBlue
()
==
255
&&
connectionColor
.
getRed
()
==
255
&&
connectionColor
.
getGreen
()
==
255
)
{
// For white color return just null to avoid explicit color set.
// It is important for dark themes
return
null
;
}
return
connectionColor
;
}
}
public
static
Shell
createCenteredShell
(
Shell
parent
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录