Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
5d7a9203
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,发现更多精彩内容 >>
提交
5d7a9203
编写于
6月 22, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove SWT colors from model (replace with RGB strings)
上级
223e8e3d
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
73 addition
and
62 deletion
+73
-62
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBPConnectionInfo.java
...r.core/src/org/jkiss/dbeaver/model/DBPConnectionInfo.java
+7
-15
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBPConnectionType.java
...r.core/src/org/jkiss/dbeaver/model/DBPConnectionType.java
+12
-15
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceProviderRegistry.java
...rg/jkiss/dbeaver/registry/DataSourceProviderRegistry.java
+4
-5
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
...re/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
+2
-6
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
....jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
+27
-4
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionPageGeneral.java
.../dbeaver/ui/dialogs/connection/ConnectionPageGeneral.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorUtils.java
...src/org/jkiss/dbeaver/ui/editors/DatabaseEditorUtils.java
+3
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/perspective/DataSourceManagementToolbar.java
...s/dbeaver/ui/perspective/DataSourceManagementToolbar.java
+3
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/preferences/PrefPageConnectionTypes.java
...jkiss/dbeaver/ui/preferences/PrefPageConnectionTypes.java
+13
-10
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/views/navigator/database/DatabaseNavigatorLabelProvider.java
...ws/navigator/database/DatabaseNavigatorLabelProvider.java
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBPConnectionInfo.java
浏览文件 @
5d7a9203
...
...
@@ -17,7 +17,6 @@
*/
package
org.jkiss.dbeaver.model
;
import
org.eclipse.swt.graphics.Color
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.net.DBWHandlerConfiguration
;
import
org.jkiss.dbeaver.model.runtime.DBRShellCommand
;
...
...
@@ -42,7 +41,7 @@ public class DBPConnectionInfo implements DBPObject
private
final
Map
<
DBPConnectionEventType
,
DBRShellCommand
>
events
;
private
final
List
<
DBWHandlerConfiguration
>
handlers
;
private
DBPConnectionType
connectionType
;
private
Color
connectionColor
;
private
String
connectionColor
;
public
DBPConnectionInfo
()
{
...
...
@@ -232,23 +231,16 @@ public class DBPConnectionInfo implements DBPObject
this
.
connectionType
=
connectionType
;
}
public
Color
getColor
()
{
Color
color
=
connectionColor
!=
null
?
connectionColor
:
connectionType
.
getColor
();
if
(
color
.
getBlue
()
==
255
&&
color
.
getRed
()
==
255
&&
color
.
getGreen
()
==
255
)
{
// For white color return just null to avoid explicit color set.
// It is important for dark themes
return
null
;
}
return
color
;
}
public
Color
getConnectionColor
()
/**
* Color in RGB format
* @return RGB color or null
*/
public
String
getConnectionColor
()
{
return
connectionColor
;
}
public
void
setConnectionColor
(
Color
color
)
public
void
setConnectionColor
(
String
color
)
{
this
.
connectionColor
=
color
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBPConnectionType.java
浏览文件 @
5d7a9203
package
org.jkiss.dbeaver.model
;
import
org.eclipse.core.runtime.IAdaptable
;
import
org.eclipse.swt.graphics.Color
;
import
org.eclipse.swt.graphics.RGB
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
/**
* Connection type
*/
public
class
DBPConnectionType
implements
IAdaptable
{
public
static
final
DBPConnectionType
DEV
=
new
DBPConnectionType
(
"dev"
,
"Development"
,
new
RGB
(
0xFF
,
0xFF
,
0xFF
)
,
"Regular development database"
,
true
,
false
,
true
);
public
static
final
DBPConnectionType
TEST
=
new
DBPConnectionType
(
"test"
,
"Test"
,
new
RGB
(
0xC4
,
0xFF
,
0xB5
)
,
"Test (QA) database"
,
true
,
false
,
true
);
public
static
final
DBPConnectionType
PROD
=
new
DBPConnectionType
(
"prod"
,
"Production"
,
new
RGB
(
0xF7
,
0x9F
,
0x81
)
,
"Production database"
,
false
,
true
,
true
);
public
static
final
DBPConnectionType
DEV
=
new
DBPConnectionType
(
"dev"
,
"Development"
,
"255,255,255"
,
"Regular development database"
,
true
,
false
,
true
);
public
static
final
DBPConnectionType
TEST
=
new
DBPConnectionType
(
"test"
,
"Test"
,
"196,255,181"
,
"Test (QA) database"
,
true
,
false
,
true
);
public
static
final
DBPConnectionType
PROD
=
new
DBPConnectionType
(
"prod"
,
"Production"
,
"247,159,129"
,
"Production database"
,
false
,
true
,
true
);
public
static
final
DBPConnectionType
[]
SYSTEM_TYPES
=
{
DEV
,
TEST
,
PROD
};
public
static
final
DBPConnectionType
DEFAULT_TYPE
=
DEV
;
private
String
id
;
private
String
name
;
private
RGB
color
;
private
String
color
;
private
String
description
;
private
boolean
autocommit
;
private
boolean
confirmExecute
;
...
...
@@ -30,16 +27,16 @@ public class DBPConnectionType implements IAdaptable {
this
(
source
.
id
,
source
.
name
,
source
.
color
,
source
.
description
,
source
.
autocommit
,
source
.
confirmExecute
,
source
.
predefined
);
}
public
DBPConnectionType
(
String
id
,
String
name
,
RGB
rgb
,
String
description
,
boolean
autocommit
,
boolean
confirmExecute
)
public
DBPConnectionType
(
String
id
,
String
name
,
String
color
,
String
description
,
boolean
autocommit
,
boolean
confirmExecute
)
{
this
(
id
,
name
,
rgb
,
description
,
autocommit
,
confirmExecute
,
false
);
this
(
id
,
name
,
color
,
description
,
autocommit
,
confirmExecute
,
false
);
}
private
DBPConnectionType
(
String
id
,
String
name
,
RGB
rgb
,
String
description
,
boolean
autocommit
,
boolean
confirmExecute
,
boolean
predefined
)
private
DBPConnectionType
(
String
id
,
String
name
,
String
color
,
String
description
,
boolean
autocommit
,
boolean
confirmExecute
,
boolean
predefined
)
{
this
.
id
=
id
;
this
.
name
=
name
;
this
.
color
=
rgb
;
this
.
color
=
color
;
this
.
description
=
description
;
this
.
autocommit
=
autocommit
;
this
.
confirmExecute
=
confirmExecute
;
...
...
@@ -66,14 +63,14 @@ public class DBPConnectionType implements IAdaptable {
this
.
name
=
name
;
}
public
Color
getColor
()
public
String
getColor
()
{
return
DBeaverUI
.
getSharedTextColors
().
getColor
(
color
)
;
return
color
;
}
public
void
setColor
(
Color
color
)
public
void
setColor
(
String
color
)
{
this
.
color
=
color
.
getRGB
()
;
this
.
color
=
color
;
}
public
String
getDescription
()
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceProviderRegistry.java
浏览文件 @
5d7a9203
...
...
@@ -17,13 +17,12 @@
*/
package
org.jkiss.dbeaver.registry
;
import
org.eclipse.core.runtime.Platform
;
import
org.jkiss.dbeaver.core.Log
;
import
org.eclipse.core.runtime.IConfigurationElement
;
import
org.eclipse.core.runtime.IExtensionRegistry
;
import
org.eclipse.
jface.resource.StringConverter
;
import
org.eclipse.
core.runtime.Platform
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.model.DBPConnectionType
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPDriver
;
...
...
@@ -309,7 +308,7 @@ public class DataSourceProviderRegistry
xml
.
startElement
(
RegistryConstants
.
TAG_TYPE
);
xml
.
addAttribute
(
RegistryConstants
.
ATTR_ID
,
connectionType
.
getId
());
xml
.
addAttribute
(
RegistryConstants
.
ATTR_NAME
,
CommonUtils
.
toString
(
connectionType
.
getName
()));
xml
.
addAttribute
(
RegistryConstants
.
ATTR_COLOR
,
StringConverter
.
asString
(
connectionType
.
getColor
().
getRGB
()
));
xml
.
addAttribute
(
RegistryConstants
.
ATTR_COLOR
,
connectionType
.
getColor
(
));
xml
.
addAttribute
(
RegistryConstants
.
ATTR_DESCRIPTION
,
CommonUtils
.
toString
(
connectionType
.
getDescription
()));
xml
.
addAttribute
(
RegistryConstants
.
ATTR_AUTOCOMMIT
,
connectionType
.
isAutocommit
());
xml
.
addAttribute
(
RegistryConstants
.
ATTR_CONFIRM_EXECUTE
,
connectionType
.
isConfirmExecute
());
...
...
@@ -373,7 +372,7 @@ public class DataSourceProviderRegistry
DBPConnectionType
connectionType
=
new
DBPConnectionType
(
atts
.
getValue
(
RegistryConstants
.
ATTR_ID
),
atts
.
getValue
(
RegistryConstants
.
ATTR_NAME
),
StringConverter
.
asRGB
(
atts
.
getValue
(
RegistryConstants
.
ATTR_COLOR
)
),
atts
.
getValue
(
RegistryConstants
.
ATTR_COLOR
),
atts
.
getValue
(
RegistryConstants
.
ATTR_DESCRIPTION
),
CommonUtils
.
getBoolean
(
atts
.
getValue
(
RegistryConstants
.
ATTR_AUTOCOMMIT
)),
CommonUtils
.
getBoolean
(
atts
.
getValue
(
RegistryConstants
.
ATTR_CONFIRM_EXECUTE
)));
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
浏览文件 @
5d7a9203
...
...
@@ -21,10 +21,8 @@ import org.eclipse.core.resources.IFile;
import
org.eclipse.core.resources.IProject
;
import
org.eclipse.core.runtime.CoreException
;
import
org.eclipse.core.runtime.IProgressMonitor
;
import
org.eclipse.jface.resource.StringConverter
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.model.*
;
import
org.jkiss.dbeaver.model.net.DBWHandlerConfiguration
;
...
...
@@ -419,7 +417,7 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
xml
.
addAttribute
(
RegistryConstants
.
ATTR_TYPE
,
connectionInfo
.
getConnectionType
().
getId
());
}
if
(
connectionInfo
.
getConnectionColor
()
!=
null
)
{
xml
.
addAttribute
(
RegistryConstants
.
ATTR_COLOR
,
StringConverter
.
asString
(
connectionInfo
.
getConnectionColor
().
getRGB
()
));
xml
.
addAttribute
(
RegistryConstants
.
ATTR_COLOR
,
connectionInfo
.
getConnectionColor
(
));
}
if
(
connectionInfo
.
getProperties
()
!=
null
)
{
...
...
@@ -654,9 +652,7 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
);
String
colorValue
=
atts
.
getValue
(
RegistryConstants
.
ATTR_COLOR
);
if
(!
CommonUtils
.
isEmpty
(
colorValue
))
{
curDataSource
.
getConnectionInfo
().
setConnectionColor
(
DBeaverUI
.
getSharedTextColors
().
getColor
(
StringConverter
.
asRGB
(
colorValue
)));
curDataSource
.
getConnectionInfo
().
setConnectionColor
(
colorValue
);
}
curDataSource
.
refreshConnectionInfo
();
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
浏览文件 @
5d7a9203
...
...
@@ -24,6 +24,7 @@ import org.eclipse.jface.commands.ActionHandler;
import
org.eclipse.jface.dialogs.IDialogConstants
;
import
org.eclipse.jface.dialogs.IDialogSettings
;
import
org.eclipse.jface.preference.PreferenceDialog
;
import
org.eclipse.jface.resource.StringConverter
;
import
org.eclipse.jface.viewers.CellEditor
;
import
org.eclipse.jface.viewers.ISelectionProvider
;
import
org.eclipse.jface.window.IShellProvider
;
...
...
@@ -54,10 +55,7 @@ import org.jkiss.dbeaver.DBException;
import
org.jkiss.dbeaver.DBeaverConstants
;
import
org.jkiss.dbeaver.DBeaverPreferences
;
import
org.jkiss.dbeaver.core.*
;
import
org.jkiss.dbeaver.model.DBPNamedObject
;
import
org.jkiss.dbeaver.model.DBPPropertyDescriptor
;
import
org.jkiss.dbeaver.model.DBPPropertySource
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.*
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.runtime.RunnableWithResult
;
import
org.jkiss.dbeaver.runtime.RuntimeUtils
;
...
...
@@ -1350,4 +1348,29 @@ public class UIUtils {
}
}
}
public
static
Color
getConnectionColor
(
DBPConnectionInfo
connectionInfo
)
{
String
rgbString
=
connectionInfo
.
getConnectionColor
();
if
(
CommonUtils
.
isEmpty
(
rgbString
))
{
rgbString
=
connectionInfo
.
getConnectionType
().
getColor
();
}
if
(
CommonUtils
.
isEmpty
(
rgbString
))
{
return
null
;
}
Color
connectionColor
=
DBeaverUI
.
getSharedTextColors
().
getColor
(
StringConverter
.
asRGB
(
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
return
null
;
}
return
connectionColor
;
}
public
static
Color
getConnectionTypeColor
(
DBPConnectionType
connectionType
)
{
String
rgbString
=
connectionType
.
getColor
();
if
(
CommonUtils
.
isEmpty
(
rgbString
))
{
return
null
;
}
return
DBeaverUI
.
getSharedTextColors
().
getColor
(
StringConverter
.
asRGB
(
rgbString
));
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionPageGeneral.java
浏览文件 @
5d7a9203
...
...
@@ -441,7 +441,7 @@ class ConnectionPageGeneral extends ActiveWizardPage<ConnectionWizard> {
{
connectionTypeCombo
.
removeAll
();
for
(
DBPConnectionType
ct
:
DataSourceProviderRegistry
.
getInstance
().
getConnectionTypes
())
{
connectionTypeCombo
.
add
(
null
,
ct
.
getName
(),
ct
.
getColor
(
),
ct
);
connectionTypeCombo
.
add
(
null
,
ct
.
getName
(),
UIUtils
.
getConnectionTypeColor
(
ct
),
ct
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorUtils.java
浏览文件 @
5d7a9203
...
...
@@ -25,6 +25,7 @@ import org.jkiss.dbeaver.model.DBPContextProvider;
import
org.jkiss.dbeaver.model.IDataSourceContainerProvider
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.struct.DBSDataSourceContainer
;
import
org.jkiss.dbeaver.ui.UIUtils
;
/**
* DB editor utils
...
...
@@ -49,12 +50,12 @@ public class DatabaseEditorUtils {
if
(
editor
instanceof
IDataSourceContainerProvider
)
{
DBSDataSourceContainer
container
=
((
IDataSourceContainerProvider
)
editor
).
getDataSourceContainer
();
if
(
container
!=
null
)
{
bgColor
=
container
.
getConnectionInfo
().
getColor
(
);
bgColor
=
UIUtils
.
getConnectionColor
(
container
.
getConnectionInfo
()
);
}
}
else
if
(
editor
instanceof
DBPContextProvider
)
{
DBCExecutionContext
context
=
((
DBPContextProvider
)
editor
).
getExecutionContext
();
if
(
context
!=
null
)
{
bgColor
=
context
.
getDataSource
().
getContainer
().
getConnectionInfo
().
getColor
(
);
bgColor
=
UIUtils
.
getConnectionColor
(
context
.
getDataSource
().
getContainer
().
getConnectionInfo
()
);
}
}
if
(
bgColor
==
null
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/perspective/DataSourceManagementToolbar.java
浏览文件 @
5d7a9203
...
...
@@ -357,12 +357,12 @@ public class DataSourceManagementToolbar implements DBPRegistryListener, DBPEven
connectionCombo
.
add
(
dsNode
==
null
?
DBIcon
.
TREE_DATABASE
.
getImage
()
:
dsNode
.
getNodeIconDefault
(),
ds
.
getName
(),
ds
.
getConnectionInfo
().
getColor
(
),
UIUtils
.
getConnectionColor
(
ds
.
getConnectionInfo
()
),
ds
);
}
else
{
TableItem
item
=
connectionCombo
.
getItem
(
i
+
1
);
item
.
setText
(
ds
.
getName
());
item
.
setBackground
(
ds
.
getConnectionInfo
().
getColor
(
));
item
.
setBackground
(
UIUtils
.
getConnectionColor
(
ds
.
getConnectionInfo
()
));
}
if
(
dataSourceContainer
==
ds
)
{
selectionIndex
=
i
+
1
;
...
...
@@ -527,7 +527,7 @@ public class DataSourceManagementToolbar implements DBPRegistryListener, DBPEven
databaseCombo
.
add
(
dbNode
.
getNodeIconDefault
(),
database
.
getName
(),
dataSource
.
getContainer
().
getConnectionInfo
().
getColor
(
),
UIUtils
.
getConnectionColor
(
dataSource
.
getContainer
().
getConnectionInfo
()
),
database
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/preferences/PrefPageConnectionTypes.java
浏览文件 @
5d7a9203
...
...
@@ -20,6 +20,7 @@ package org.jkiss.dbeaver.ui.preferences;
import
org.eclipse.core.runtime.IAdaptable
;
import
org.eclipse.jface.preference.PreferencePage
;
import
org.eclipse.jface.resource.StringConverter
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.*
;
import
org.eclipse.swt.graphics.Color
;
...
...
@@ -110,7 +111,7 @@ public class PrefPageConnectionTypes extends PreferencePage implements IWorkbenc
DBPConnectionType
newType
=
new
DBPConnectionType
(
SecurityUtils
.
generateUniqueId
(),
name
,
new
RGB
(
0xFF
,
0xFF
,
0xFF
)
,
"255,255,255"
,
"New type"
,
true
,
false
);
...
...
@@ -180,7 +181,7 @@ public class PrefPageConnectionTypes extends PreferencePage implements IWorkbenc
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
getSelectedType
().
setColor
(
colorPicker
.
getItem
(
colorPicker
.
getSelectionIndex
()).
getBackground
(
));
getSelectedType
().
setColor
(
StringConverter
.
asString
(
colorPicker
.
getItem
(
colorPicker
.
getSelectionIndex
()).
getBackground
().
getRGB
()
));
updateTableInfo
();
}
});
...
...
@@ -192,7 +193,7 @@ public class PrefPageConnectionTypes extends PreferencePage implements IWorkbenc
{
DBPConnectionType
connectionType
=
getSelectedType
();
ColorDialog
colorDialog
=
new
ColorDialog
(
parent
.
getShell
());
colorDialog
.
setRGB
(
connectionType
.
getColor
().
getRGB
(
));
colorDialog
.
setRGB
(
StringConverter
.
asRGB
(
connectionType
.
getColor
()
));
RGB
rgb
=
colorDialog
.
open
();
if
(
rgb
!=
null
)
{
Color
color
=
null
;
...
...
@@ -209,7 +210,7 @@ public class PrefPageConnectionTypes extends PreferencePage implements IWorkbenc
colorPicker
.
add
(
null
,
COLOR_TEXT
,
color
,
color
);
}
colorPicker
.
select
(
color
);
getSelectedType
().
setColor
(
color
);
getSelectedType
().
setColor
(
StringConverter
.
asString
(
color
.
getRGB
())
);
updateTableInfo
();
}
}
...
...
@@ -251,7 +252,7 @@ public class PrefPageConnectionTypes extends PreferencePage implements IWorkbenc
private
void
showSelectedType
(
DBPConnectionType
connectionType
)
{
colorPicker
.
select
(
connectionType
.
getColor
(
));
colorPicker
.
select
(
UIUtils
.
getConnectionTypeColor
(
connectionType
));
typeName
.
setText
(
connectionType
.
getName
());
typeDescription
.
setText
(
connectionType
.
getDescription
());
autocommitCheck
.
setSelection
(
connectionType
.
isAutocommit
());
...
...
@@ -267,8 +268,9 @@ public class PrefPageConnectionTypes extends PreferencePage implements IWorkbenc
if
(
item
.
getData
()
==
connectionType
)
{
item
.
setText
(
0
,
connectionType
.
getName
());
item
.
setText
(
1
,
connectionType
.
getDescription
());
item
.
setBackground
(
0
,
connectionType
.
getColor
());
item
.
setBackground
(
1
,
connectionType
.
getColor
());
Color
connectionColor
=
UIUtils
.
getConnectionTypeColor
(
connectionType
);
item
.
setBackground
(
0
,
connectionColor
);
item
.
setBackground
(
1
,
connectionColor
);
break
;
}
}
...
...
@@ -319,9 +321,10 @@ public class PrefPageConnectionTypes extends PreferencePage implements IWorkbenc
item
.
setText
(
0
,
connectionType
.
getName
());
item
.
setText
(
1
,
CommonUtils
.
toString
(
connectionType
.
getDescription
()));
if
(
connectionType
.
getColor
()
!=
null
)
{
item
.
setBackground
(
0
,
connectionType
.
getColor
());
item
.
setBackground
(
1
,
connectionType
.
getColor
());
colorPicker
.
add
(
null
,
COLOR_TEXT
,
connectionType
.
getColor
(),
connectionType
.
getColor
());
Color
connectionColor
=
UIUtils
.
getConnectionTypeColor
(
connectionType
);
item
.
setBackground
(
0
,
connectionColor
);
item
.
setBackground
(
1
,
connectionColor
);
colorPicker
.
add
(
null
,
COLOR_TEXT
,
connectionColor
,
connectionColor
);
}
item
.
setData
(
connectionType
);
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/views/navigator/database/DatabaseNavigatorLabelProvider.java
浏览文件 @
5d7a9203
...
...
@@ -134,7 +134,7 @@ class DatabaseNavigatorLabelProvider extends LabelProvider implements IFontProvi
if
(
element
instanceof
DBNDataSource
)
{
DataSourceDescriptor
ds
=
((
DBNDatabaseNode
)
element
).
getDataSourceContainer
();
if
(
ds
!=
null
)
{
return
ds
.
getConnectionInfo
().
getColor
(
);
return
UIUtils
.
getConnectionColor
(
ds
.
getConnectionInfo
()
);
}
}
return
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录