Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
a216ac22
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,发现更多精彩内容 >>
提交
a216ac22
编写于
8月 08, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#6216 Filters management enhancement (save, customize, menu redesign)
Former-commit-id:
406574cc
上级
29d6c7fc
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
80 addition
and
17 deletion
+80
-17
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDAttributeBindingElement.java
.../jkiss/dbeaver/model/data/DBDAttributeBindingElement.java
+20
-0
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDAttributeBindingMeta.java
...org/jkiss/dbeaver/model/data/DBDAttributeBindingMeta.java
+17
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDAttributeBindingNested.java
...g/jkiss/dbeaver/model/data/DBDAttributeBindingNested.java
+6
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDAttributeBindingType.java
...org/jkiss/dbeaver/model/data/DBDAttributeBindingType.java
+18
-3
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/lightgrid/LightGrid.java
...rc/org/jkiss/dbeaver/ui/controls/lightgrid/LightGrid.java
+10
-7
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
.../jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
+9
-5
未找到文件。
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDAttributeBindingElement.java
浏览文件 @
a216ac22
...
...
@@ -21,6 +21,7 @@ import org.jkiss.code.Nullable;
import
org.jkiss.dbeaver.model.*
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.struct.DBSEntityAttribute
;
import
org.jkiss.utils.CommonUtils
;
/**
* Collection element binding info
...
...
@@ -154,4 +155,23 @@ public class DBDAttributeBindingElement extends DBDAttributeBindingNested implem
public
DBPImage
getObjectImage
()
{
return
DBValueFormatting
.
getObjectImage
(
collection
.
getComponentType
());
}
@Override
public
String
toString
()
{
return
collection
.
toString
()
+
"@"
+
index
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
return
super
.
equals
(
obj
)
&&
obj
instanceof
DBDAttributeBindingElement
&&
CommonUtils
.
equalObjects
(
collection
,
((
DBDAttributeBindingElement
)
obj
).
collection
)
&&
index
==
((
DBDAttributeBindingElement
)
obj
).
index
;
}
@Override
public
int
hashCode
()
{
return
collection
.
hashCode
()
+
index
;
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDAttributeBindingMeta.java
浏览文件 @
a216ac22
...
...
@@ -65,7 +65,6 @@ public class DBDAttributeBindingMeta extends DBDAttributeBinding {
showLabel
=
dataSource
==
null
||
!
dataSource
.
getContainer
().
getPreferenceStore
().
getBoolean
(
ModelPreferences
.
RESULT_SET_IGNORE_COLUMN_LABEL
);
}
@Nullable
@Override
public
DBPDataSource
getDataSource
()
{
return
dataContainer
.
getDataSource
();
...
...
@@ -102,6 +101,7 @@ public class DBDAttributeBindingMeta extends DBDAttributeBinding {
return
pseudoAttribute
!=
null
;
}
@NotNull
@Override
public
DBSDataContainer
getDataContainer
()
{
return
dataContainer
;
...
...
@@ -252,6 +252,11 @@ public class DBDAttributeBindingMeta extends DBDAttributeBinding {
this
.
pseudoAttribute
=
pseudoAttribute
;
}
@Override
public
String
toString
()
{
return
metaAttribute
.
toString
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
DBDAttributeBindingMeta
)
{
...
...
@@ -267,4 +272,15 @@ public class DBDAttributeBindingMeta extends DBDAttributeBinding {
}
return
false
;
}
@Override
public
int
hashCode
()
{
return
CommonUtils
.
notEmpty
(
metaAttribute
.
getName
()).
hashCode
()
+
CommonUtils
.
notEmpty
(
metaAttribute
.
getLabel
()).
hashCode
()
+
CommonUtils
.
notEmpty
(
metaAttribute
.
getEntityName
()).
hashCode
()
+
metaAttribute
.
getOrdinalPosition
()
+
metaAttribute
.
getTypeID
()
+
CommonUtils
.
notEmpty
(
metaAttribute
.
getTypeName
()).
hashCode
();
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDAttributeBindingNested.java
浏览文件 @
a216ac22
...
...
@@ -22,6 +22,7 @@ import org.jkiss.dbeaver.model.DBPDataSource;
import
org.jkiss.dbeaver.model.exec.DBCAttributeMetaData
;
import
org.jkiss.dbeaver.model.exec.DBCEntityMetaData
;
import
org.jkiss.dbeaver.model.struct.DBSEntityReferrer
;
import
org.jkiss.utils.CommonUtils
;
import
java.util.List
;
...
...
@@ -86,5 +87,9 @@ public abstract class DBDAttributeBindingNested extends DBDAttributeBinding impl
return
null
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
return
obj
instanceof
DBDAttributeBindingNested
&&
CommonUtils
.
equalObjects
(
parent
,
((
DBDAttributeBindingNested
)
obj
).
parent
);
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDAttributeBindingType.java
浏览文件 @
a216ac22
...
...
@@ -18,21 +18,19 @@ package org.jkiss.dbeaver.model.data;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.*
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.struct.DBSAttributeBase
;
import
org.jkiss.dbeaver.model.struct.DBSEntity
;
import
org.jkiss.dbeaver.model.struct.DBSEntityAttribute
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.utils.CommonUtils
;
/**
* Type attribute value binding info
*/
public
class
DBDAttributeBindingType
extends
DBDAttributeBindingNested
implements
DBPImageProvider
{
private
static
final
Log
log
=
Log
.
getLog
(
DBDAttributeBindingType
.
class
);
@NotNull
private
final
DBSAttributeBase
attribute
;
...
...
@@ -191,4 +189,21 @@ public class DBDAttributeBindingType extends DBDAttributeBindingNested implement
public
long
getMaxLength
()
{
return
attribute
.
getMaxLength
();
}
@Override
public
String
toString
()
{
return
attribute
.
toString
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
return
super
.
equals
(
obj
)
&&
obj
instanceof
DBDAttributeBindingType
&&
CommonUtils
.
equalObjects
(
attribute
,
((
DBDAttributeBindingType
)
obj
).
attribute
);
}
@Override
public
int
hashCode
()
{
return
attribute
.
hashCode
();
}
}
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/lightgrid/LightGrid.java
浏览文件 @
a216ac22
...
...
@@ -492,13 +492,13 @@ public abstract class LightGrid extends Canvas {
int
savedHSB
=
keepState
?
hScroll
.
getSelection
()
:
-
1
;
int
savedVSB
=
keepState
?
vScroll
.
getSelection
()
:
-
1
;
int
[]
oldWidths
=
null
;
Map
<
Object
,
Integer
>
oldWidths
=
null
;
if
(
keepState
&&
!
controlWasHidden
)
{
// Save widths
oldWidths
=
new
int
[
columns
.
size
()]
;
oldWidths
=
new
HashMap
<>()
;
if
(!
columns
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
columns
.
size
();
i
++
)
{
oldWidths
[
i
]
=
columns
.
get
(
i
).
getWidth
(
);
for
(
GridColumn
column
:
columns
)
{
oldWidths
.
put
(
column
.
getElement
(),
column
.
getWidth
()
);
}
}
}
...
...
@@ -595,9 +595,12 @@ public abstract class LightGrid extends Canvas {
if
(
oldWidths
!=
null
)
{
// Restore widths
if
(
oldWidths
.
length
==
columns
.
size
())
{
for
(
int
i
=
0
;
i
<
oldWidths
.
length
;
i
++)
{
columns
.
get
(
i
).
setWidth
(
oldWidths
[
i
]);
if
(
oldWidths
.
size
()
==
columns
.
size
())
{
for
(
GridColumn
column
:
columns
)
{
Integer
newWidth
=
oldWidths
.
get
(
column
.
getElement
());
if
(
newWidth
!=
null
)
{
column
.
setWidth
(
newWidth
);
}
}
}
}
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
浏览文件 @
a216ac22
...
...
@@ -145,6 +145,7 @@ public class ResultSetViewer extends Viewer
public
static
final
String
DEFAULT_QUERY_TEXT
=
"SQL"
;
private
static
final
DecimalFormat
ROW_COUNT_FORMAT
=
new
DecimalFormat
(
"###,###,###,###,###,##0"
);
private
static
final
String
CUSTOM_FILTER_VALUE_STRING
=
".."
;
private
static
final
IResultSetListener
[]
EMPTY_LISTENERS
=
new
IResultSetListener
[
0
];
private
IResultSetFilterManager
filterManager
;
...
...
@@ -4100,7 +4101,7 @@ public class ResultSetViewer extends Viewer
Object
getValue
(
@NotNull
ResultSetViewer
viewer
,
@NotNull
DBDAttributeBinding
attribute
,
@NotNull
DBCLogicalOperator
operator
,
boolean
useDefault
)
{
if
(
useDefault
)
{
return
".."
;
return
CUSTOM_FILTER_VALUE_STRING
;
}
else
{
ResultSetRow
[]
rows
=
null
;
if
(
operator
.
getArgumentCount
()
<
0
)
{
...
...
@@ -4146,15 +4147,18 @@ public class ResultSetViewer extends Viewer
private
String
translateFilterPattern
(
DBCLogicalOperator
operator
,
FilterByAttributeType
type
,
DBDAttributeBinding
attribute
)
{
Object
value
=
type
.
getValue
(
this
,
attribute
,
operator
,
true
);
DBCExecutionContext
executionContext
=
getExecutionContext
();
String
strValue
=
executionContext
==
null
?
String
.
valueOf
(
value
)
:
attribute
.
getValueHandler
().
getValueDisplayString
(
attribute
,
value
,
DBDDisplayFormat
.
UI
);
strValue
=
strValue
.
trim
();
strValue
=
CommonUtils
.
cutExtraLines
(
strValue
,
1
);
strValue
=
CommonUtils
.
truncateString
(
strValue
,
30
);
strValue
=
strValue
.
replaceAll
(
"\\s+"
,
" "
).
replace
(
"@"
,
"^"
).
trim
();
strValue
=
UITextUtils
.
getShortText
(
sizingGC
,
strValue
,
150
);
if
(
operator
.
getArgumentCount
()
==
0
)
{
return
operator
.
getStringValue
();
}
else
{
return
operator
.
getStringValue
()
+
" "
+
CommonUtils
.
truncateString
(
strValue
,
64
);
if
(!
CUSTOM_FILTER_VALUE_STRING
.
equals
(
strValue
))
{
strValue
=
"'"
+
strValue
+
"'"
;
}
return
operator
.
getStringValue
()
+
" "
+
strValue
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录