Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
35ce6678
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,发现更多精彩内容 >>
提交
35ce6678
编写于
9月 29, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Registry refactoring
上级
4d127287
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
58 addition
and
50 deletion
+58
-50
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverClassLoader.java
...ore/src/org/jkiss/dbeaver/registry/DriverClassLoader.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverDescriptor.java
...core/src/org/jkiss/dbeaver/registry/DriverDescriptor.java
+24
-24
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverFileManager.java
...ore/src/org/jkiss/dbeaver/registry/DriverFileManager.java
+3
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverLibraryDescriptor.java
...c/org/jkiss/dbeaver/registry/DriverLibraryDescriptor.java
+1
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/RuntimeUtils.java
...aver.core/src/org/jkiss/dbeaver/runtime/RuntimeUtils.java
+4
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/project/ProjectExportWizard.java
.../org/jkiss/dbeaver/tools/project/ProjectExportWizard.java
+2
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/project/ProjectImportWizard.java
.../org/jkiss/dbeaver/tools/project/ProjectImportWizard.java
+2
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
...iss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
+6
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadDialog.java
...jkiss/dbeaver/ui/dialogs/driver/DriverDownloadDialog.java
+5
-4
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
...jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
+4
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
...org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
+3
-3
plugins/org.jkiss.dbeaver.ext.import-config/src/org/jkiss/dbeaver/ext/import_config/wizards/ConfigImportWizard.java
...dbeaver/ext/import_config/wizards/ConfigImportWizard.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
...r.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
+2
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverClassLoader.java
浏览文件 @
35ce6678
...
...
@@ -43,7 +43,7 @@ public class DriverClassLoader extends URLClassLoader
protected
String
findLibrary
(
String
libname
)
{
String
nativeName
=
System
.
mapLibraryName
(
libname
);
for
(
D
riverLibraryDescriptor
driverFile
:
driver
.
getDriverLibraries
())
{
for
(
D
BPDriverLibrary
driverFile
:
driver
.
getDriverLibraries
())
{
if
(
driverFile
.
getType
()
==
DBPDriverLibrary
.
FileType
.
lib
&&
driverFile
.
matchesCurrentPlatform
())
{
final
File
localFile
=
driverFile
.
getLocalFile
();
if
(
localFile
!=
null
&&
localFile
.
exists
())
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverDescriptor.java
浏览文件 @
35ce6678
...
...
@@ -102,7 +102,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
private
boolean
disabled
;
private
final
List
<
String
>
clientHomeIds
=
new
ArrayList
<
String
>();
private
final
List
<
DriverFileSource
>
fileSources
=
new
ArrayList
<
DriverFileSource
>();
private
final
List
<
DriverLibraryDescriptor
>
fil
es
=
new
ArrayList
<
DriverLibraryDescriptor
>();
private
final
List
<
DriverLibraryDescriptor
>
librari
es
=
new
ArrayList
<
DriverLibraryDescriptor
>();
private
final
List
<
DriverLibraryDescriptor
>
origFiles
=
new
ArrayList
<
DriverLibraryDescriptor
>();
private
final
List
<
DBPPropertyDescriptor
>
connectionPropertyDescriptors
=
new
ArrayList
<
DBPPropertyDescriptor
>();
private
final
List
<
OSDescriptor
>
supportedSystems
=
new
ArrayList
<
OSDescriptor
>();
...
...
@@ -169,9 +169,9 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
this
.
isLoaded
=
false
;
for
(
IConfigurationElement
lib
:
config
.
getChildren
(
RegistryConstants
.
TAG_FILE
))
{
this
.
fil
es
.
add
(
new
DriverLibraryDescriptor
(
this
,
lib
));
this
.
librari
es
.
add
(
new
DriverLibraryDescriptor
(
this
,
lib
));
}
this
.
origFiles
.
addAll
(
this
.
fil
es
);
this
.
origFiles
.
addAll
(
this
.
librari
es
);
for
(
IConfigurationElement
lib
:
config
.
getChildren
(
RegistryConstants
.
TAG_FILE_SOURCE
))
{
this
.
fileSources
.
add
(
new
DriverFileSource
(
lib
));
...
...
@@ -429,7 +429,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
private
boolean
hasValidLibraries
()
{
for
(
DriverLibraryDescriptor
lib
:
fil
es
)
{
for
(
DriverLibraryDescriptor
lib
:
librari
es
)
{
File
file
=
lib
.
getLocalFile
();
if
(
file
!=
null
&&
file
.
exists
())
{
return
true
;
...
...
@@ -636,12 +636,12 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
@Override
public
Collection
<
DriverLibraryDescriptor
>
getDriverLibraries
()
{
return
fil
es
;
return
librari
es
;
}
public
DriverLibraryDescriptor
getDriver
File
(
String
path
)
public
DriverLibraryDescriptor
getDriver
Library
(
String
path
)
{
for
(
DriverLibraryDescriptor
lib
:
fil
es
)
{
for
(
DriverLibraryDescriptor
lib
:
librari
es
)
{
if
(
lib
.
getPath
().
equals
(
path
))
{
return
lib
;
}
...
...
@@ -649,36 +649,36 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
return
null
;
}
public
DriverLibraryDescriptor
addDriver
File
(
String
path
,
DBPDriverLibrary
.
FileType
fileType
)
public
DriverLibraryDescriptor
addDriver
Library
(
String
path
,
DBPDriverLibrary
.
FileType
fileType
)
{
for
(
DriverLibraryDescriptor
lib
:
fil
es
)
{
for
(
DriverLibraryDescriptor
lib
:
librari
es
)
{
if
(
lib
.
getPath
().
equals
(
path
))
{
return
lib
;
}
}
DriverLibraryDescriptor
lib
=
new
DriverLibraryDescriptor
(
this
,
fileType
,
path
);
addDriver
File
(
lib
);
addDriver
Library
(
lib
);
return
lib
;
}
public
boolean
addDriver
File
(
DriverLibraryDescriptor
descriptor
)
public
boolean
addDriver
Library
(
DriverLibraryDescriptor
descriptor
)
{
resetDriverInstance
();
if
(!
fil
es
.
contains
(
descriptor
))
{
this
.
fil
es
.
add
(
descriptor
);
if
(!
librari
es
.
contains
(
descriptor
))
{
this
.
librari
es
.
add
(
descriptor
);
return
true
;
}
return
false
;
}
public
boolean
removeDriver
File
(
DriverLibraryDescriptor
lib
)
public
boolean
removeDriver
Library
(
DriverLibraryDescriptor
lib
)
{
resetDriverInstance
();
if
(!
lib
.
isCustom
())
{
lib
.
setDisabled
(
true
);
return
true
;
}
else
{
return
this
.
fil
es
.
remove
(
lib
);
return
this
.
librari
es
.
remove
(
lib
);
}
}
...
...
@@ -772,7 +772,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
public
String
getLicense
()
{
for
(
DriverLibraryDescriptor
file
:
fil
es
)
{
for
(
DriverLibraryDescriptor
file
:
librari
es
)
{
if
(
file
.
getType
()
==
DBPDriverLibrary
.
FileType
.
license
)
{
final
File
licenseFile
=
file
.
getLocalFile
();
if
(
licenseFile
!=
null
&&
licenseFile
.
exists
())
{
...
...
@@ -849,7 +849,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
List
<
URL
>
libraryURLs
=
new
ArrayList
<
URL
>();
// Load libraries
for
(
DriverLibraryDescriptor
file
:
fil
es
)
{
for
(
DriverLibraryDescriptor
file
:
librari
es
)
{
if
(
file
.
isDisabled
()
||
file
.
getType
()
!=
DBPDriverLibrary
.
FileType
.
jar
)
{
continue
;
}
...
...
@@ -876,7 +876,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
@Override
public
void
validateFilesPresence
(
final
DBRRunnableContext
runnableContext
)
{
for
(
DriverLibraryDescriptor
file
:
fil
es
)
{
for
(
DriverLibraryDescriptor
file
:
librari
es
)
{
if
(
file
.
isCustom
())
{
File
localFile
=
file
.
getLocalFile
();
if
(
localFile
!=
null
&&
localFile
.
exists
())
{
...
...
@@ -886,8 +886,8 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
}
}
final
List
<
D
riverLibraryDescriptor
>
downloadCandidates
=
new
ArrayList
<
DriverLibraryDescriptor
>();
for
(
D
riverLibraryDescriptor
file
:
fil
es
)
{
final
List
<
D
BPDriverLibrary
>
downloadCandidates
=
new
ArrayList
<
DBPDriverLibrary
>();
for
(
D
BPDriverLibrary
file
:
librari
es
)
{
if
(
file
.
isDisabled
()
||
!
file
.
isDownloadable
())
{
// Nothing we can do about it
continue
;
...
...
@@ -915,7 +915,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
public
boolean
acceptDriverLicenses
(
DBRRunnableContext
runnableContext
)
{
// User must accept all licenses before actual drivers download
for
(
final
DriverLibraryDescriptor
file
:
getDriverLibraries
()
)
{
for
(
final
DriverLibraryDescriptor
file
:
libraries
)
{
if
(
file
.
getType
()
==
DBPDriverLibrary
.
FileType
.
license
)
{
final
File
libraryFile
=
file
.
getLocalFile
();
if
(
libraryFile
==
null
||
!
libraryFile
.
exists
())
{
...
...
@@ -1028,7 +1028,7 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
}
// Libraries
for
(
DriverLibraryDescriptor
lib
:
this
.
getDriverLibraries
()
)
{
for
(
DriverLibraryDescriptor
lib
:
libraries
)
{
if
((
export
&&
!
lib
.
isDisabled
())
||
lib
.
isCustom
()
||
lib
.
isDisabled
())
{
xml
.
startElement
(
RegistryConstants
.
TAG_LIBRARY
);
xml
.
addAttribute
(
RegistryConstants
.
ATTR_TYPE
,
lib
.
getType
().
name
());
...
...
@@ -1202,12 +1202,12 @@ public class DriverDescriptor extends AbstractDescriptor implements DBPDriver
}
}
String
path
=
atts
.
getValue
(
RegistryConstants
.
ATTR_PATH
);
DriverLibraryDescriptor
lib
=
curDriver
.
getDriver
File
(
path
);
DriverLibraryDescriptor
lib
=
curDriver
.
getDriver
Library
(
path
);
String
disabledAttr
=
atts
.
getValue
(
RegistryConstants
.
ATTR_DISABLED
);
if
(
lib
!=
null
&&
CommonUtils
.
getBoolean
(
disabledAttr
))
{
lib
.
setDisabled
(
true
);
}
else
if
(
lib
==
null
)
{
curDriver
.
addDriver
File
(
path
,
type
);
curDriver
.
addDriver
Library
(
path
,
type
);
}
}
else
if
(
localName
.
equals
(
RegistryConstants
.
TAG_CLIENT_HOME
))
{
curDriver
.
addClientHomeId
(
atts
.
getValue
(
RegistryConstants
.
ATTR_ID
));
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverFileManager.java
浏览文件 @
35ce6678
...
...
@@ -18,6 +18,7 @@
package
org.jkiss.dbeaver.registry
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.DBPDriverLibrary
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.registry.maven.MavenArtifact
;
import
org.jkiss.dbeaver.registry.maven.MavenArtifactReference
;
...
...
@@ -37,7 +38,7 @@ public class DriverFileManager
{
static
final
Log
log
=
Log
.
getLog
(
DriverFileManager
.
class
);
public
static
void
downloadLibraryFile
(
DBRProgressMonitor
monitor
,
D
riverLibraryDescriptor
library
,
boolean
updateVersion
)
throws
IOException
,
InterruptedException
public
static
void
downloadLibraryFile
(
DBRProgressMonitor
monitor
,
D
BPDriverLibrary
library
,
boolean
updateVersion
)
throws
IOException
,
InterruptedException
{
if
(
library
.
isMavenArtifact
())
{
MavenArtifact
artifact
=
downloadMavenArtifact
(
monitor
,
library
,
updateVersion
);
...
...
@@ -104,7 +105,7 @@ public class DriverFileManager
monitor
.
done
();
}
private
static
MavenArtifact
downloadMavenArtifact
(
DBRProgressMonitor
monitor
,
D
riverLibraryDescriptor
library
,
boolean
updateVersion
)
throws
IOException
{
private
static
MavenArtifact
downloadMavenArtifact
(
DBRProgressMonitor
monitor
,
D
BPDriverLibrary
library
,
boolean
updateVersion
)
throws
IOException
{
MavenArtifactReference
artifactInfo
=
new
MavenArtifactReference
(
library
.
getPath
());
if
(
updateVersion
)
{
MavenRegistry
.
getInstance
().
resetArtifactInfo
(
artifactInfo
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DriverLibraryDescriptor.java
浏览文件 @
35ce6678
...
...
@@ -138,6 +138,7 @@ public class DriverLibraryDescriptor implements DBPDriverLibrary
return
path
.
startsWith
(
FILE_SOURCE_REPO
);
}
@Override
public
boolean
isMavenArtifact
()
{
return
path
.
startsWith
(
FILE_SOURCE_MAVEN
);
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/RuntimeUtils.java
浏览文件 @
35ce6678
...
...
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.jobs.Job;
import
org.eclipse.jface.operation.IRunnableContext
;
import
org.eclipse.jface.operation.IRunnableWithProgress
;
import
org.eclipse.swt.program.Program
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.DBeaverPreferences
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.core.CoreMessages
;
...
...
@@ -129,7 +130,8 @@ public class RuntimeUtils {
return
DBeaverCore
.
getInstance
().
getLocalSystem
().
isWindows
()
?
binName
+
".exe"
:
binName
;
}
public
static
IStatus
stripStack
(
IStatus
status
)
{
@NotNull
public
static
IStatus
stripStack
(
@NotNull
IStatus
status
)
{
if
(
status
instanceof
MultiStatus
)
{
IStatus
[]
children
=
status
.
getChildren
();
if
(
children
!=
null
)
{
...
...
@@ -145,7 +147,7 @@ public class RuntimeUtils {
}
return
new
Status
(
status
.
getSeverity
(),
status
.
getPlugin
(),
status
.
getCode
(),
messagePrefix
+
status
.
getMessage
(),
null
);
}
return
null
;
return
status
;
}
public
static
void
pause
(
int
ms
)
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/project/ProjectExportWizard.java
浏览文件 @
35ce6678
...
...
@@ -29,6 +29,7 @@ import org.eclipse.ui.IExportWizard;
import
org.eclipse.ui.IWorkbench
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.model.DBPDriverLibrary
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress
;
import
org.jkiss.dbeaver.registry.*
;
...
...
@@ -182,7 +183,7 @@ public class ProjectExportWizard extends Wizard implements IExportWizard {
Set
<
File
>
libFiles
=
new
HashSet
<
File
>();
Map
<
String
,
File
>
libPathMap
=
new
HashMap
<
String
,
File
>();
for
(
DriverDescriptor
driver
:
exportData
.
usedDrivers
)
{
for
(
D
riverLibraryDescriptor
fileDescriptor
:
driver
.
getDriverLibraries
())
{
for
(
D
BPDriverLibrary
fileDescriptor
:
driver
.
getDriverLibraries
())
{
final
File
libraryFile
=
fileDescriptor
.
getLocalFile
();
if
(
libraryFile
!=
null
&&
!
fileDescriptor
.
isDisabled
()
&&
libraryFile
.
exists
())
{
libFiles
.
add
(
libraryFile
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/project/ProjectImportWizard.java
浏览文件 @
35ce6678
...
...
@@ -280,7 +280,7 @@ public class ProjectImportWizard extends Wizard implements IImportWizard {
File
libFile
=
new
File
(
libPath
);
if
(
libFile
.
exists
())
{
// Just use path as-is (may be it is local re-import or local environments equal to export environment)
driver
.
addDriver
File
(
libPath
,
DBPDriverLibrary
.
FileType
.
jar
);
driver
.
addDriver
Library
(
libPath
,
DBPDriverLibrary
.
FileType
.
jar
);
}
else
{
// Get driver library from archive
String
archiveLibEntry
=
libMap
.
get
(
libPath
);
...
...
@@ -312,7 +312,7 @@ public class ProjectImportWizard extends Wizard implements IImportWizard {
while
(
relativePath
.
charAt
(
0
)
==
'/'
||
relativePath
.
charAt
(
0
)
==
'\\'
)
{
relativePath
=
relativePath
.
substring
(
1
);
}
driver
.
addDriver
File
(
relativePath
,
DBPDriverLibrary
.
FileType
.
jar
);
driver
.
addDriver
Library
(
relativePath
,
DBPDriverLibrary
.
FileType
.
jar
);
}
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
浏览文件 @
35ce6678
...
...
@@ -29,7 +29,6 @@ import org.jkiss.dbeaver.model.runtime.DBRRunnableContext;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress
;
import
org.jkiss.dbeaver.registry.DriverDescriptor
;
import
org.jkiss.dbeaver.registry.DriverFileManager
;
import
org.jkiss.dbeaver.registry.DriverLibraryDescriptor
;
import
org.jkiss.dbeaver.runtime.RunnableContextDelegate
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.utils.GeneralUtils
;
...
...
@@ -69,7 +68,7 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
filesTable
.
setHeaderVisible
(
true
);
filesTable
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
UIUtils
.
createTableColumn
(
filesTable
,
SWT
.
LEFT
,
"File"
);
for
(
D
riverLibraryDescriptor
file
:
wizard
.
getFiles
())
{
for
(
D
BPDriverLibrary
file
:
wizard
.
getFiles
())
{
new
TableItem
(
filesTable
,
SWT
.
NONE
).
setText
(
file
.
getDisplayName
());
}
UIUtils
.
packColumns
(
filesTable
,
true
);
...
...
@@ -91,14 +90,14 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
downloadLibraryFiles
(
new
RunnableContextDelegate
(
getContainer
()),
getWizard
().
getFiles
());
}
private
void
downloadLibraryFiles
(
DBRRunnableContext
runnableContext
,
final
List
<
DriverLibraryDescriptor
>
files
)
private
void
downloadLibraryFiles
(
DBRRunnableContext
runnableContext
,
final
List
<
?
extends
DBPDriverLibrary
>
files
)
{
if
(!
getWizard
().
getDriver
().
acceptDriverLicenses
(
runnableContext
))
{
return
;
}
for
(
int
i
=
0
,
filesSize
=
files
.
size
();
i
<
filesSize
;
)
{
D
riverLibraryDescriptor
lib
=
files
.
get
(
i
);
D
BPDriverLibrary
lib
=
files
.
get
(
i
);
int
result
=
downloadLibraryFile
(
runnableContext
,
lib
);
switch
(
result
)
{
case
IDialogConstants
.
CANCEL_ID
:
...
...
@@ -114,7 +113,7 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
}
}
private
int
downloadLibraryFile
(
DBRRunnableContext
runnableContext
,
final
D
riverLibraryDescriptor
file
)
private
int
downloadLibraryFile
(
DBRRunnableContext
runnableContext
,
final
D
BPDriverLibrary
file
)
{
try
{
runnableContext
.
run
(
true
,
true
,
new
DBRRunnableWithProgress
()
{
...
...
@@ -142,11 +141,11 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
}
private
class
DownloadRetry
implements
Runnable
{
private
final
D
riverLibraryDescriptor
file
;
private
final
D
BPDriverLibrary
file
;
private
final
Throwable
error
;
private
int
result
;
public
DownloadRetry
(
D
riverLibraryDescriptor
file
,
Throwable
error
)
public
DownloadRetry
(
D
BPDriverLibrary
file
,
Throwable
error
)
{
this
.
file
=
file
;
this
.
error
=
error
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadDialog.java
浏览文件 @
35ce6678
...
...
@@ -24,6 +24,7 @@ import org.eclipse.swt.widgets.Composite;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.Shell
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.model.DBPDriverLibrary
;
import
org.jkiss.dbeaver.registry.DriverDescriptor
;
import
org.jkiss.dbeaver.registry.DriverLibraryDescriptor
;
import
org.jkiss.dbeaver.ui.DBeaverIcons
;
...
...
@@ -41,7 +42,7 @@ public class DriverDownloadDialog extends WizardDialog
private
boolean
doDownload
=
false
;
DriverDownloadDialog
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
DriverLibraryDescriptor
>
files
,
boolean
updateVersion
,
boolean
forceDownload
)
DriverDownloadDialog
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
?
extends
DBPDriverLibrary
>
files
,
boolean
updateVersion
,
boolean
forceDownload
)
{
super
(
shell
,
new
DriverDownloadWizard
(
driver
,
files
,
updateVersion
,
forceDownload
));
getWizard
().
init
(
DBeaverUI
.
getActiveWorkbenchWindow
().
getWorkbench
(),
null
);
...
...
@@ -110,18 +111,18 @@ public class DriverDownloadDialog extends WizardDialog
super
.
finishPressed
();
}
public
static
boolean
downloadDriverFiles
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
D
riverLibraryDescriptor
>
files
)
{
public
static
boolean
downloadDriverFiles
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
D
BPDriverLibrary
>
files
)
{
return
downloadDriverFiles
(
shell
,
driver
,
files
,
false
);
}
public
static
boolean
downloadDriverFiles
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
D
riverLibraryDescriptor
>
files
,
boolean
forceDownload
)
{
public
static
boolean
downloadDriverFiles
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
D
BPDriverLibrary
>
files
,
boolean
forceDownload
)
{
DriverDownloadDialog
dialog
=
new
DriverDownloadDialog
(
shell
,
driver
,
files
,
false
,
forceDownload
);
dialog
.
setMinimumPageSize
(
100
,
100
);
dialog
.
open
();
return
dialog
.
doDownload
;
}
public
static
boolean
updateDriverFiles
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
DriverLibraryDescriptor
>
files
,
boolean
forceDownload
)
{
public
static
boolean
updateDriverFiles
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
?
extends
DBPDriverLibrary
>
files
,
boolean
forceDownload
)
{
DriverDownloadDialog
dialog
=
new
DriverDownloadDialog
(
shell
,
driver
,
files
,
true
,
forceDownload
);
dialog
.
setMinimumPageSize
(
100
,
100
);
dialog
.
open
();
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
浏览文件 @
35ce6678
...
...
@@ -23,6 +23,7 @@ import org.eclipse.jface.wizard.Wizard;
import
org.eclipse.ui.IExportWizard
;
import
org.eclipse.ui.IWorkbench
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.model.DBPDriverLibrary
;
import
org.jkiss.dbeaver.registry.DriverDescriptor
;
import
org.jkiss.dbeaver.registry.DriverLibraryDescriptor
;
import
org.jkiss.dbeaver.ui.UIUtils
;
...
...
@@ -35,12 +36,12 @@ public class DriverDownloadWizard extends Wizard implements IExportWizard {
private
static
final
String
DRIVER_DOWNLOAD_DIALOG_SETTINGS
=
"DriverDownload"
;
//$NON-NLS-1$
private
DriverDescriptor
driver
;
private
List
<
DriverLibraryDescriptor
>
files
;
private
List
<
?
extends
DBPDriverLibrary
>
files
;
private
boolean
updateVersion
;
private
boolean
forceDownload
;
private
DriverDownloadPage
downloadPage
;
public
DriverDownloadWizard
(
@NotNull
DriverDescriptor
driver
,
List
<
DriverLibraryDescriptor
>
files
,
boolean
updateVersion
,
boolean
forceDownload
)
{
public
DriverDownloadWizard
(
@NotNull
DriverDescriptor
driver
,
List
<
?
extends
DBPDriverLibrary
>
files
,
boolean
updateVersion
,
boolean
forceDownload
)
{
this
.
driver
=
driver
;
this
.
files
=
files
;
this
.
updateVersion
=
updateVersion
;
...
...
@@ -54,7 +55,7 @@ public class DriverDownloadWizard extends Wizard implements IExportWizard {
return
driver
;
}
List
<
DriverLibraryDescriptor
>
getFiles
()
{
List
<
?
extends
DBPDriverLibrary
>
getFiles
()
{
return
files
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
浏览文件 @
35ce6678
...
...
@@ -707,11 +707,11 @@ public class DriverEditDialog extends HelpEnabledDialog
// Set libraries
for
(
DriverLibraryDescriptor
lib
:
CommonUtils
.
safeCollection
(
libList
))
{
driver
.
addDriver
File
(
lib
);
driver
.
addDriver
Library
(
lib
);
}
for
(
DriverLibraryDescriptor
lib
:
CommonUtils
.
copyList
(
driver
.
getDriverLibraries
()))
{
if
(!
libList
.
contains
(
lib
))
{
driver
.
removeDriver
File
(
lib
);
driver
.
removeDriver
Library
(
lib
);
}
}
...
...
@@ -781,7 +781,7 @@ public class DriverEditDialog extends HelpEnabledDialog
{
java
.
util
.
List
<
File
>
libFiles
=
new
ArrayList
<
File
>();
java
.
util
.
List
<
URL
>
libURLs
=
new
ArrayList
<
URL
>();
for
(
D
riverLibraryDescriptor
lib
:
libList
)
{
for
(
D
BPDriverLibrary
lib
:
libList
)
{
File
libFile
=
lib
.
getLocalFile
();
if
(
libFile
!=
null
&&
libFile
.
exists
()
&&
!
libFile
.
isDirectory
()
&&
lib
.
getType
()
==
DBPDriverLibrary
.
FileType
.
jar
)
{
libFiles
.
add
(
libFile
);
...
...
plugins/org.jkiss.dbeaver.ext.import-config/src/org/jkiss/dbeaver/ext/import_config/wizards/ConfigImportWizard.java
浏览文件 @
35ce6678
...
...
@@ -122,7 +122,7 @@ public abstract class ConfigImportWizard extends Wizard implements IImportWizard
driver
.
setDescription
(
driverInfo
.
getDescription
());
driver
.
setDriverDefaultPort
(
driverInfo
.
getDefaultPort
());
for
(
String
path
:
driverInfo
.
getLibraries
())
{
driver
.
addDriver
File
(
path
,
DBPDriverLibrary
.
FileType
.
jar
);
driver
.
addDriver
Library
(
path
,
DBPDriverLibrary
.
FileType
.
jar
);
}
driver
.
setModified
(
true
);
genericProvider
.
addDriver
(
driver
);
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBPDriverLibrary.java
浏览文件 @
35ce6678
...
...
@@ -58,6 +58,8 @@ public interface DBPDriverLibrary
boolean
isDownloadable
();
boolean
isMavenArtifact
();
@Nullable
String
getExternalURL
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录