Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
一剑流云
dbeaver
提交
5af68c70
D
dbeaver
项目概览
一剑流云
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
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,发现更多精彩内容 >>
提交
5af68c70
编写于
2月 03, 2017
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Value managers registry fix (datasource name)
上级
84a5adfd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
15 deletion
+22
-15
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetValueController.java
...eaver/ui/controls/resultset/ResultSetValueController.java
+2
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/registry/ValueManagerDescriptor.java
...kiss/dbeaver/ui/data/registry/ValueManagerDescriptor.java
+14
-9
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/registry/ValueManagerRegistry.java
.../jkiss/dbeaver/ui/data/registry/ValueManagerRegistry.java
+4
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
...rg/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
+1
-1
plugins/org.jkiss.dbeaver.ext.generic/plugin.xml
plugins/org.jkiss.dbeaver.ext.generic/plugin.xml
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetValueController.java
浏览文件 @
5af68c70
...
@@ -169,8 +169,9 @@ public class ResultSetValueController implements IAttributeController, IRowContr
...
@@ -169,8 +169,9 @@ public class ResultSetValueController implements IAttributeController, IRowContr
@Override
@Override
public
IValueManager
getValueManager
()
{
public
IValueManager
getValueManager
()
{
DBSAttributeBase
valueType
=
binding
.
getPresentationAttribute
();
DBSAttributeBase
valueType
=
binding
.
getPresentationAttribute
();
final
DBCExecutionContext
executionContext
=
getExecutionContext
();
return
ValueManagerRegistry
.
findValueManager
(
return
ValueManagerRegistry
.
findValueManager
(
getDataSourceContainer
(),
executionContext
==
null
?
null
:
executionContext
.
getDataSource
(),
valueType
,
valueType
,
getValueHandler
().
getValueObjectType
(
valueType
));
getValueHandler
().
getValueObjectType
(
valueType
));
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/registry/ValueManagerDescriptor.java
浏览文件 @
5af68c70
...
@@ -21,6 +21,7 @@ import org.jkiss.code.NotNull;
...
@@ -21,6 +21,7 @@ import org.jkiss.code.NotNull;
import
org.jkiss.code.Nullable
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.DBPDataKind
;
import
org.jkiss.dbeaver.model.DBPDataKind
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.impl.AbstractDescriptor
;
import
org.jkiss.dbeaver.model.impl.AbstractDescriptor
;
import
org.jkiss.dbeaver.model.struct.DBSDataType
;
import
org.jkiss.dbeaver.model.struct.DBSDataType
;
...
@@ -61,7 +62,7 @@ public class ValueManagerDescriptor extends AbstractDescriptor
...
@@ -61,7 +62,7 @@ public class ValueManagerDescriptor extends AbstractDescriptor
DBPDataKind
dataKind
;
DBPDataKind
dataKind
;
ObjectType
valueType
;
ObjectType
valueType
;
String
extension
;
String
extension
;
DataSourceProviderDescriptor
dataSource
;
String
dataSource
;
}
}
private
IValueManager
instance
;
private
IValueManager
instance
;
...
@@ -80,7 +81,7 @@ public class ValueManagerDescriptor extends AbstractDescriptor
...
@@ -80,7 +81,7 @@ public class ValueManagerDescriptor extends AbstractDescriptor
String
className
=
typeElement
.
getAttribute
(
ATTR_TYPE
);
String
className
=
typeElement
.
getAttribute
(
ATTR_TYPE
);
String
ext
=
typeElement
.
getAttribute
(
ATTR_EXTENSION
);
String
ext
=
typeElement
.
getAttribute
(
ATTR_EXTENSION
);
String
dspId
=
typeElement
.
getAttribute
(
ATTR_DATA_SOURCE
);
String
dspId
=
typeElement
.
getAttribute
(
ATTR_DATA_SOURCE
);
if
(!
CommonUtils
.
isEmpty
(
kindName
)
||
!
CommonUtils
.
isEmpty
(
typeName
)
||
!
CommonUtils
.
isEmpty
(
className
)
||
!
CommonUtils
.
isEmpty
(
kindName
)
||
!
CommonUtils
.
isEmpty
(
ext
))
{
if
(!
CommonUtils
.
isEmpty
(
kindName
)
||
!
CommonUtils
.
isEmpty
(
typeName
)
||
!
CommonUtils
.
isEmpty
(
className
)
||
!
CommonUtils
.
isEmpty
(
dspId
)
||
!
CommonUtils
.
isEmpty
(
ext
))
{
SupportInfo
info
=
new
SupportInfo
();
SupportInfo
info
=
new
SupportInfo
();
if
(!
CommonUtils
.
isEmpty
(
kindName
))
{
if
(!
CommonUtils
.
isEmpty
(
kindName
))
{
try
{
try
{
...
@@ -99,10 +100,7 @@ public class ValueManagerDescriptor extends AbstractDescriptor
...
@@ -99,10 +100,7 @@ public class ValueManagerDescriptor extends AbstractDescriptor
info
.
extension
=
ext
;
info
.
extension
=
ext
;
}
}
if
(!
CommonUtils
.
isEmpty
(
dspId
))
{
if
(!
CommonUtils
.
isEmpty
(
dspId
))
{
info
.
dataSource
=
DataSourceProviderRegistry
.
getInstance
().
getDataSourceProvider
(
dspId
);
info
.
dataSource
=
dspId
;
if
(
info
.
dataSource
==
null
)
{
log
.
warn
(
"Data source '"
+
dspId
+
"' not found"
);
}
}
}
supportInfos
.
add
(
info
);
supportInfos
.
add
(
info
);
}
}
...
@@ -128,13 +126,13 @@ public class ValueManagerDescriptor extends AbstractDescriptor
...
@@ -128,13 +126,13 @@ public class ValueManagerDescriptor extends AbstractDescriptor
return
instance
;
return
instance
;
}
}
public
boolean
supportsType
(
@Nullable
DBPDataSource
Container
dataSource
,
DBSTypedObject
typedObject
,
Class
<?>
valueType
,
boolean
checkDataSource
,
boolean
checkType
)
public
boolean
supportsType
(
@Nullable
DBPDataSource
dataSource
,
DBSTypedObject
typedObject
,
Class
<?>
valueType
,
boolean
checkDataSource
,
boolean
checkType
)
{
{
final
DBPDataKind
dataKind
=
typedObject
.
getDataKind
();
final
DBPDataKind
dataKind
=
typedObject
.
getDataKind
();
for
(
SupportInfo
info
:
supportInfos
)
{
for
(
SupportInfo
info
:
supportInfos
)
{
if
(
dataSource
!=
null
&&
info
.
dataSource
!=
null
)
{
if
(
dataSource
!=
null
&&
info
.
dataSource
!=
null
)
{
DriverDescriptor
driver
=
(
DriverDescriptor
)
dataSource
.
getDriver
();
DriverDescriptor
driver
=
(
DriverDescriptor
)
dataSource
.
get
Container
().
get
Driver
();
if
(
driver
.
getProviderDescriptor
()
!=
info
.
dataSource
)
{
if
(
!
info
.
dataSource
.
equals
(
driver
.
getProviderDescriptor
().
getId
())
&&
!
info
.
dataSource
.
equals
(
dataSource
.
getClass
().
getName
())
)
{
continue
;
continue
;
}
}
}
else
if
(
checkDataSource
)
{
}
else
if
(
checkDataSource
)
{
...
@@ -169,8 +167,15 @@ public class ValueManagerDescriptor extends AbstractDescriptor
...
@@ -169,8 +167,15 @@ public class ValueManagerDescriptor extends AbstractDescriptor
return
true
;
return
true
;
}
}
}
}
if
(!
checkType
&&
info
.
valueType
==
null
&&
info
.
dataKind
==
null
&&
info
.
typeName
==
null
&&
info
.
extension
==
null
)
{
return
true
;
}
}
}
return
false
;
return
false
;
}
}
@Override
public
String
toString
()
{
return
id
;
}
}
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/registry/ValueManagerRegistry.java
浏览文件 @
5af68c70
...
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.IExtensionRegistry;
...
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.IExtensionRegistry;
import
org.eclipse.core.runtime.Platform
;
import
org.eclipse.core.runtime.Platform
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.data.DBDContent
;
import
org.jkiss.dbeaver.model.data.DBDContent
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
...
@@ -66,7 +67,7 @@ public class ValueManagerRegistry {
...
@@ -66,7 +67,7 @@ public class ValueManagerRegistry {
}
}
@NotNull
@NotNull
public
IValueManager
getManager
(
@Nullable
DBPDataSource
Container
dataSource
,
@NotNull
DBSTypedObject
dataKind
,
@NotNull
Class
<?>
valueType
)
{
public
IValueManager
getManager
(
@Nullable
DBPDataSource
dataSource
,
@NotNull
DBSTypedObject
dataKind
,
@NotNull
Class
<?>
valueType
)
{
// Check starting from most restrictive to less restrictive
// Check starting from most restrictive to less restrictive
IValueManager
manager
=
findManager
(
dataSource
,
dataKind
,
valueType
,
true
,
true
);
IValueManager
manager
=
findManager
(
dataSource
,
dataKind
,
valueType
,
true
,
true
);
if
(
manager
==
null
)
{
if
(
manager
==
null
)
{
...
@@ -84,7 +85,7 @@ public class ValueManagerRegistry {
...
@@ -84,7 +85,7 @@ public class ValueManagerRegistry {
return
manager
;
return
manager
;
}
}
private
IValueManager
findManager
(
@Nullable
DBPDataSource
Container
dataSource
,
DBSTypedObject
typedObject
,
Class
<?>
valueType
,
boolean
checkDataSource
,
boolean
checkType
)
{
private
IValueManager
findManager
(
@Nullable
DBPDataSource
dataSource
,
DBSTypedObject
typedObject
,
Class
<?>
valueType
,
boolean
checkDataSource
,
boolean
checkType
)
{
for
(
ValueManagerDescriptor
manager
:
managers
)
{
for
(
ValueManagerDescriptor
manager
:
managers
)
{
if
(
manager
.
supportsType
(
dataSource
,
typedObject
,
valueType
,
checkDataSource
,
checkType
))
{
if
(
manager
.
supportsType
(
dataSource
,
typedObject
,
valueType
,
checkDataSource
,
checkType
))
{
return
manager
.
getInstance
();
return
manager
.
getInstance
();
...
@@ -94,7 +95,7 @@ public class ValueManagerRegistry {
...
@@ -94,7 +95,7 @@ public class ValueManagerRegistry {
}
}
@NotNull
@NotNull
public
static
IValueManager
findValueManager
(
@Nullable
DBPDataSource
Container
dataSource
,
@NotNull
DBSTypedObject
typedObject
,
@NotNull
Class
<?>
valueType
)
{
public
static
IValueManager
findValueManager
(
@Nullable
DBPDataSource
dataSource
,
@NotNull
DBSTypedObject
typedObject
,
@NotNull
Class
<?>
valueType
)
{
return
getInstance
().
getManager
(
dataSource
,
typedObject
,
valueType
);
return
getInstance
().
getManager
(
dataSource
,
typedObject
,
valueType
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
浏览文件 @
5af68c70
...
@@ -451,7 +451,7 @@ public class ComplexObjectEditor extends TreeViewer {
...
@@ -451,7 +451,7 @@ public class ComplexObjectEditor extends TreeViewer {
public
IValueManager
getValueManager
()
{
public
IValueManager
getValueManager
()
{
DBSTypedObject
valueType
=
getValueType
();
DBSTypedObject
valueType
=
getValueType
();
return
ValueManagerRegistry
.
findValueManager
(
return
ValueManagerRegistry
.
findValueManager
(
getExecutionContext
().
getDataSource
()
.
getContainer
()
,
getExecutionContext
().
getDataSource
(),
valueType
,
valueType
,
getValueHandler
().
getValueObjectType
(
valueType
));
getValueHandler
().
getValueObjectType
(
valueType
));
}
}
...
...
plugins/org.jkiss.dbeaver.ext.generic/plugin.xml
浏览文件 @
5af68c70
...
@@ -792,7 +792,7 @@
...
@@ -792,7 +792,7 @@
id=
"org.jkiss.dbeaver.ext.generic.data.GenericValueHandlerProvider"
id=
"org.jkiss.dbeaver.ext.generic.data.GenericValueHandlerProvider"
label=
"Generic data types provider"
>
label=
"Generic data types provider"
>
<datasource
id=
"generic"
/>
<datasource
id=
"generic"
/>
<!-- Date/time value handler - needed to provide native dat
a
time value formatting. Formatting itself provided in drivers configuration. -->
<!-- Date/time value handler - needed to provide native dat
e
time value formatting. Formatting itself provided in drivers configuration. -->
<type
kind=
"DATETIME"
/>
<type
kind=
"DATETIME"
/>
</provider>
</provider>
</extension>
</extension>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录