Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
29c6f7ec
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,发现更多精彩内容 >>
提交
29c6f7ec
编写于
10月 17, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Driver editor fix.
上级
d57de522
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
32 addition
and
69 deletion
+32
-69
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverDescriptor.java
...c/org/jkiss/dbeaver/registry/driver/DriverDescriptor.java
+25
-61
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
...org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
+7
-8
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/driver/DriverDescriptor.java
浏览文件 @
29c6f7ec
...
...
@@ -101,11 +101,17 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
private
final
DataSourceProviderDescriptor
providerDescriptor
;
private
final
String
id
;
private
String
category
;
private
String
name
,
origName
;
private
String
description
,
origDescription
;
private
String
driverClassName
,
origClassName
;
private
String
driverDefaultPort
,
origDefaultPort
;
private
String
sampleURL
,
origSampleURL
;
private
final
String
origName
;
private
final
String
origDescription
;
private
final
String
origClassName
;
private
final
String
origDefaultPort
;
private
final
String
origSampleURL
;
private
String
name
;
private
String
description
;
private
String
driverClassName
;
private
String
driverDefaultPort
;
private
String
sampleURL
;
private
String
note
;
private
String
webURL
;
private
DBPImage
iconPlain
;
...
...
@@ -149,6 +155,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
System
.
setProperty
(
PROP_DRIVERS_LOCATION
,
driversHome
.
getAbsolutePath
());
}
// New driver constructor
public
DriverDescriptor
(
DataSourceProviderDescriptor
providerDescriptor
,
String
id
)
{
super
(
providerDescriptor
.
getPluginId
());
...
...
@@ -157,8 +164,14 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
this
.
custom
=
true
;
this
.
iconPlain
=
providerDescriptor
.
getIcon
();
makeIconExtensions
();
this
.
origName
=
null
;
this
.
origDescription
=
null
;
this
.
origClassName
=
null
;
this
.
origDefaultPort
=
null
;
this
.
origSampleURL
=
null
;
}
// Predefined driver constructor
public
DriverDescriptor
(
DataSourceProviderDescriptor
providerDescriptor
,
IConfigurationElement
config
)
{
super
(
providerDescriptor
.
getPluginId
());
...
...
@@ -170,12 +183,9 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
this
.
note
=
config
.
getAttribute
(
RegistryConstants
.
ATTR_NOTE
);
this
.
origClassName
=
this
.
driverClassName
=
config
.
getAttribute
(
RegistryConstants
.
ATTR_CLASS
);
if
(!
CommonUtils
.
isEmpty
(
config
.
getAttribute
(
RegistryConstants
.
ATTR_DEFAULT_PORT
)))
{
try
{
this
.
origDefaultPort
=
this
.
driverDefaultPort
=
config
.
getAttribute
(
RegistryConstants
.
ATTR_DEFAULT_PORT
);
}
catch
(
NumberFormatException
ex
)
{
log
.
warn
(
"Bad default port for driver '"
+
name
+
"' specified: "
+
ex
.
getMessage
());
}
}
else
{
this
.
origDefaultPort
=
this
.
driverDefaultPort
=
null
;
}
this
.
origSampleURL
=
this
.
sampleURL
=
config
.
getAttribute
(
RegistryConstants
.
ATTR_SAMPLE_URL
);
this
.
webURL
=
config
.
getAttribute
(
RegistryConstants
.
ATTR_WEB_URL
);
...
...
@@ -224,9 +234,6 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
}
}
// Connection default properties
//connectionProperties
{
// Driver parameters
IConfigurationElement
[]
paramElements
=
config
.
getChildren
(
RegistryConstants
.
TAG_PARAMETER
);
...
...
@@ -269,12 +276,6 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
}
}
}
// Create class loader
this
.
classLoader
=
new
DriverClassLoader
(
this
,
new
URL
[
0
],
//getClass().getClassLoader());
getClass
().
getClassLoader
());
}
public
DriverDescriptor
getReplacedBy
()
...
...
@@ -617,38 +618,6 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
return
libraries
;
}
/*
@NotNull
private DBPDriverDependencies resolveDependencies(@NotNull DBRProgressMonitor monitor) throws DBException {
try (DBPDriverContext driverContext = new DBPDriverContext(monitor)) {
DriverDependencies depsResolver = new DriverDependencies();
depsResolver.resolveDependencies(driverContext, getDriverLibraries());
return depsResolver;
}
}
private DBPDriverDependencies resolveDependencies(DBRRunnableContext runnableContext) throws DBException {
try {
final DBPDriverDependencies[] deps = new DBPDriverDependencies[1];
runnableContext.run(true, true, new DBRRunnableWithProgress() {
@Override
public void run(DBRProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
deps[0] = resolveDependencies(monitor);
} catch (DBException e) {
throw new InvocationTargetException(e);
}
}
});
return deps[0];
} catch (InvocationTargetException e) {
throw new DBException("Error resolving libraries", e.getTargetException());
} catch (InterruptedException e) {
throw new DBException("Resolve interrupted", e);
}
}
*/
public
DBPDriverLibrary
getDriverLibrary
(
String
path
)
{
for
(
DBPDriverLibrary
lib
:
libraries
)
{
...
...
@@ -768,11 +737,6 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
customParameters
.
putAll
(
parameters
);
}
// public List<OSDescriptor> getSupportedSystems()
// {
// return supportedSystems;
// }
@Override
public
boolean
isSupportedByLocalSystem
()
{
...
...
@@ -810,10 +774,10 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
public
void
loadDriver
(
DBRRunnableContext
runnableContext
)
throws
DBException
{
this
.
loadDriver
(
runnableContext
,
false
,
false
);
this
.
loadDriver
(
runnableContext
,
false
);
}
private
void
loadDriver
(
DBRRunnableContext
runnableContext
,
boolean
forceReload
,
boolean
omitDownload
)
private
void
loadDriver
(
DBRRunnableContext
runnableContext
,
boolean
forceReload
)
throws
DBException
{
if
(
isLoaded
&&
!
forceReload
)
{
...
...
@@ -821,7 +785,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
}
isLoaded
=
false
;
loadLibraries
(
runnableContext
);
loadLibraries
();
if
(!
acceptDriverLicenses
(
runnableContext
))
{
throw
new
DBException
(
"You have to accept driver '"
+
getFullName
()
+
"' license to be able to connect"
);
...
...
@@ -857,7 +821,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
}
}
private
void
loadLibraries
(
DBRRunnableContext
runnableContext
)
private
void
loadLibraries
()
throws
DBException
{
this
.
classLoader
=
null
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
浏览文件 @
29c6f7ec
...
...
@@ -85,9 +85,11 @@ public class DriverEditDialog extends HelpEnabledDialog
private
static
final
String
DIALOG_ID
=
"DBeaver.DriverEditDialog"
;
//$NON-NLS-1$
private
final
boolean
newDriver
;
private
DataSourceProviderDescriptor
provider
;
private
String
defaultCategory
;
private
DriverDescriptor
driver
;
private
String
defaultCategory
;
private
String
curFolder
=
null
;
private
TableViewer
libTable
;
private
Button
deleteButton
;
...
...
@@ -109,20 +111,23 @@ public class DriverEditDialog extends HelpEnabledDialog
private
PropertySourceCustom
connectionPropertySource
;
private
ClientHomesPanel
clientHomesPanel
;
private
Button
embeddedDriverCheck
;
//private Button anonymousCheck;
public
DriverEditDialog
(
Shell
shell
,
DriverDescriptor
driver
)
{
super
(
shell
,
IHelpContextIds
.
CTX_DRIVER_EDITOR
);
this
.
driver
=
driver
;
this
.
provider
=
driver
.
getProviderDescriptor
();
this
.
defaultCategory
=
driver
.
getCategory
();
this
.
newDriver
=
false
;
}
public
DriverEditDialog
(
Shell
shell
,
DataSourceProviderDescriptor
provider
,
String
category
)
{
super
(
shell
,
IHelpContextIds
.
CTX_DRIVER_EDITOR
);
this
.
provider
=
provider
;
this
.
driver
=
provider
.
createDriver
();
this
.
defaultCategory
=
category
;
this
.
newDriver
=
true
;
}
@Override
...
...
@@ -142,10 +147,8 @@ public class DriverEditDialog extends HelpEnabledDialog
@Override
protected
Control
createDialogArea
(
Composite
parent
)
{
boolean
newDriver
=
driver
==
null
;
if
(
newDriver
)
{
getShell
().
setText
(
CoreMessages
.
dialog_edit_driver_title_create_driver
);
driver
=
provider
.
createDriver
();
}
else
{
getShell
().
setText
(
CoreMessages
.
dialog_edit_driver_title_edit_driver
+
driver
.
getName
()
+
"'"
);
//$NON-NLS-2$
getShell
().
setImage
(
DBeaverIcons
.
getImage
(
driver
.
getPlainIcon
()));
...
...
@@ -311,18 +314,14 @@ public class DriverEditDialog extends HelpEnabledDialog
{
Composite
libsListGroup
=
new
Composite
(
libsGroup
,
SWT
.
NONE
);
gd
=
new
GridData
(
GridData
.
FILL_BOTH
);
//gd.heightHint = 200;
libsListGroup
.
setLayoutData
(
gd
);
GridLayout
layout
=
new
GridLayout
(
1
,
false
);
layout
.
marginHeight
=
0
;
layout
.
marginWidth
=
0
;
libsListGroup
.
setLayout
(
layout
);
//gd = new GridData(GridData.FILL_HORIZONTAL);
// Additional libraries list
libTable
=
new
TableViewer
(
libsListGroup
,
SWT
.
BORDER
|
SWT
.
SINGLE
|
SWT
.
V_SCROLL
|
SWT
.
H_SCROLL
);
//libsTable.setLinesVisible (true);
//libsTable.setHeaderVisible (true);
libTable
.
setContentProvider
(
new
ListContentProvider
());
libTable
.
setLabelProvider
(
new
CellLabelProvider
()
{
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录