Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
f3e24d1d
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,发现更多精彩内容 >>
提交
f3e24d1d
编写于
5月 20, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'devel' of
https://github.com/serge-rider/dbeaver
into devel
上级
1dce0b0d
02e70614
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
70 addition
and
14 deletion
+70
-14
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ColorSettingsDialog.java
...ss/dbeaver/ui/controls/resultset/ColorSettingsDialog.java
+0
-2
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetModel.java
...g/jkiss/dbeaver/ui/controls/resultset/ResultSetModel.java
+35
-6
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetRow.java
...org/jkiss/dbeaver/ui/controls/resultset/ResultSetRow.java
+13
-1
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
.../jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
+2
-1
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
...ntrols/resultset/spreadsheet/SpreadsheetPresentation.java
+20
-4
未找到文件。
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ColorSettingsDialog.java
浏览文件 @
f3e24d1d
...
...
@@ -313,8 +313,6 @@ class ColorSettingsDialog extends BaseDialog {
}
bgColorSelector2
.
setEnabled
(
isRange
);
fgColorSelector2
.
setEnabled
(
isRange
);
singleColumnCheck
.
setEnabled
(
false
);
}
private
IValueEditor
createValueEditor
(
Composite
panel
,
int
index
)
{
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetModel.java
浏览文件 @
f3e24d1d
...
...
@@ -618,14 +618,14 @@ public class ResultSetModel {
private
void
updateRowColors
(
boolean
reset
,
List
<
ResultSetRow
>
rows
)
{
if
(
colorMapping
.
isEmpty
()
||
reset
)
{
for
(
ResultSetRow
row
:
rows
)
{
row
.
foreground
=
null
;
row
.
background
=
null
;
row
.
colorInfo
=
null
;
}
}
if
(!
colorMapping
.
isEmpty
())
{
for
(
Map
.
Entry
<
DBDAttributeBinding
,
List
<
AttributeColorSettings
>>
entry
:
colorMapping
.
entrySet
())
{
for
(
ResultSetRow
row
:
rows
)
{
for
(
AttributeColorSettings
acs
:
entry
.
getValue
())
{
Color
background
=
null
,
foreground
=
null
;
if
(
acs
.
rangeCheck
)
{
if
(
acs
.
attributeValues
!=
null
&&
acs
.
attributeValues
.
length
>
1
)
{
double
minValue
=
ResultSetUtils
.
makeNumericValue
(
acs
.
attributeValues
[
0
]);
...
...
@@ -635,18 +635,47 @@ public class ResultSetModel {
final
Object
cellValue
=
getCellValue
(
binding
,
row
);
double
value
=
ResultSetUtils
.
makeNumericValue
(
cellValue
);
if
(
value
>=
minValue
&&
value
<=
maxValue
)
{
foreground
=
acs
.
colorForeground
;
RGB
rowRGB
=
ResultSetUtils
.
makeGradientValue
(
acs
.
colorBackground
.
getRGB
(),
acs
.
colorBackground2
.
getRGB
(),
minValue
,
maxValue
,
value
);
row
.
background
=
UIUtils
.
getSharedColor
(
rowRGB
);
background
=
UIUtils
.
getSharedColor
(
rowRGB
);
}
}
}
}
else
{
final
DBDAttributeBinding
binding
=
entry
.
getKey
();
final
Object
cellValue
=
getCellValue
(
binding
,
row
);
if
(
acs
.
evaluate
(
cellValue
))
{
row
.
foreground
=
acs
.
colorForeground
;
row
.
background
=
acs
.
colorBackground
;
foreground
=
acs
.
colorForeground
;
background
=
acs
.
colorBackground
;
}
}
if
(
foreground
!=
null
||
background
!=
null
)
{
ResultSetRow
.
ColorInfo
colorInfo
=
row
.
colorInfo
;
if
(
colorInfo
==
null
)
{
colorInfo
=
new
ResultSetRow
.
ColorInfo
();
row
.
colorInfo
=
colorInfo
;
}
if
(!
acs
.
singleColumn
)
{
colorInfo
.
rowForeground
=
acs
.
colorForeground
;
colorInfo
.
rowBackground
=
acs
.
colorBackground
;
}
else
{
// Single column color
if
(
foreground
!=
null
)
{
Color
[]
cellFgColors
=
colorInfo
.
cellFgColors
;
if
(
cellFgColors
==
null
)
{
cellFgColors
=
new
Color
[
attributes
.
length
];
colorInfo
.
cellFgColors
=
cellFgColors
;
}
cellFgColors
[
entry
.
getKey
().
getOrdinalPosition
()]
=
foreground
;
}
if
(
background
!=
null
)
{
Color
[]
cellBgColors
=
colorInfo
.
cellBgColors
;
if
(
cellBgColors
==
null
)
{
cellBgColors
=
new
Color
[
attributes
.
length
];
colorInfo
.
cellBgColors
=
cellBgColors
;
}
cellBgColors
[
entry
.
getKey
().
getOrdinalPosition
()]
=
background
;
}
}
}
}
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetRow.java
浏览文件 @
f3e24d1d
...
...
@@ -37,6 +37,17 @@ public class ResultSetRow {
public
static
final
byte
STATE_ADDED
=
2
;
public
static
final
byte
STATE_REMOVED
=
3
;
public
static
class
ColorInfo
{
@Nullable
public
Color
rowForeground
;
@Nullable
public
Color
rowBackground
;
@Nullable
public
Color
[]
cellFgColors
;
@Nullable
public
Color
[]
cellBgColors
;
}
// Physical row number
private
int
rowNumber
;
// Row number in grid
...
...
@@ -50,7 +61,8 @@ public class ResultSetRow {
private
byte
state
;
@Nullable
public
Map
<
DBDValue
,
CollectionElementData
>
collections
;
public
Color
foreground
,
background
;
@Nullable
public
ColorInfo
colorInfo
;
ResultSetRow
(
int
rowNumber
,
@NotNull
Object
[]
values
)
{
this
.
rowNumber
=
rowNumber
;
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
浏览文件 @
f3e24d1d
...
...
@@ -2226,6 +2226,7 @@ public class ResultSetViewer extends Viewer
viewMenu
.
add
(
customizeAction
);
}
viewMenu
.
add
(
new
TransformComplexTypesToggleAction
());
viewMenu
.
add
(
new
Separator
());
viewMenu
.
add
(
new
ColorizeDataTypesToggleAction
());
{
if
(
valueController
!=
null
)
{
...
...
@@ -2238,8 +2239,8 @@ public class ResultSetViewer extends Viewer
if
(
getModel
().
getSingleSource
()
!=
null
&&
getModel
().
hasColorMapping
(
getModel
().
getSingleSource
()))
{
viewMenu
.
add
(
new
ResetAllColorAction
());
}
viewMenu
.
add
(
new
Separator
());
}
viewMenu
.
add
(
new
Separator
());
viewMenu
.
add
(
new
VirtualEntityEditAction
());
viewMenu
.
add
(
new
Action
(
ResultSetMessages
.
controls_resultset_viewer_action_data_formats
)
{
@Override
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
浏览文件 @
f3e24d1d
...
...
@@ -1625,8 +1625,16 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
return
foregroundSelected
;
}
ResultSetRow
row
=
(
ResultSetRow
)
(!
controller
.
isRecordMode
()
?
rowElement
:
colElement
);
if
(
row
.
foreground
!=
null
)
{
return
row
.
foreground
;
if
(
row
.
colorInfo
!=
null
)
{
if
(
row
.
colorInfo
.
cellFgColors
!=
null
)
{
Color
cellFG
=
row
.
colorInfo
.
cellFgColors
[((
DBDAttributeBinding
)
(
rowElement
instanceof
DBDAttributeBinding
?
rowElement
:
colElement
)).
getOrdinalPosition
()];
if
(
cellFG
!=
null
)
{
return
cellFG
;
}
}
if
(
row
.
colorInfo
.
rowForeground
!=
null
)
{
return
row
.
colorInfo
.
rowForeground
;
}
}
Object
value
=
getCellValue
(
colElement
,
rowElement
,
false
);
...
...
@@ -1687,8 +1695,16 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
return
backgroundModified
;
}
if
(
row
.
background
!=
null
)
{
return
row
.
background
;
if
(
row
.
colorInfo
!=
null
)
{
if
(
row
.
colorInfo
.
cellBgColors
!=
null
)
{
Color
cellBG
=
row
.
colorInfo
.
cellBgColors
[((
DBDAttributeBinding
)
(
rowElement
instanceof
DBDAttributeBinding
?
rowElement
:
colElement
)).
getOrdinalPosition
()];
if
(
cellBG
!=
null
)
{
return
cellBG
;
}
}
if
(
row
.
colorInfo
.
rowBackground
!=
null
)
{
return
row
.
colorInfo
.
rowBackground
;
}
}
Object
value
=
controller
.
getModel
().
getCellValue
(
attribute
,
row
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录