Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
01ac41cd
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,发现更多精彩内容 >>
提交
01ac41cd
编写于
9月 14, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Maven artifact update
上级
11d20176
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
71 addition
and
31 deletion
+71
-31
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
...iss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
+25
-15
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadDialog.java
...jkiss/dbeaver/ui/dialogs/driver/DriverDownloadDialog.java
+30
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
...jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
+7
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
...org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
+9
-8
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadAutoPage.java
浏览文件 @
01ac41cd
...
...
@@ -25,10 +25,7 @@ import org.eclipse.swt.events.SelectionAdapter;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Link
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.swt.widgets.Text
;
import
org.eclipse.swt.widgets.*
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.model.DBPDriverFile
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
...
...
@@ -60,22 +57,35 @@ class DriverDownloadAutoPage extends DriverDownloadPage {
final
DriverDescriptor
driver
=
wizard
.
getDriver
();
setMessage
(
"Download "
+
driver
.
getFullName
()
+
" driver files"
);
StringBuilder
message
=
new
StringBuilder
();
message
.
append
(
""
).
append
(
driver
.
getFullName
())
.
append
(
" driver files are missing.\nDBeaver can download these files automatically.\n\nFiles required by driver:"
);
for
(
DriverFileDescriptor
file
:
wizard
.
getFiles
())
{
message
.
append
(
"\n\t-"
).
append
(
file
.
getPath
());
}
message
.
append
(
"\n\nOr you can obtain driver files by yourself and add them in driver editor."
);
initializeDialogUnits
(
parent
);
Composite
composite
=
UIUtils
.
createPlaceholder
(
parent
,
1
);
composite
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
Text
infoText
=
new
Text
(
composite
,
SWT
.
MULTI
|
SWT
.
READ_ONLY
|
SWT
.
WRAP
);
infoText
.
setText
(
message
.
toString
());
infoText
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
if
(!
wizard
.
isForceDownload
())
{
Label
infoText
=
new
Label
(
composite
,
SWT
.
NONE
);
infoText
.
setText
(
driver
.
getFullName
()
+
" driver files are missing.\nDBeaver can download these files automatically.\n\n"
);
infoText
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
}
{
Group
filesGroup
=
UIUtils
.
createControlGroup
(
composite
,
"Files required by driver"
,
1
,
-
1
,
-
1
);
filesGroup
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
Table
filesTable
=
new
Table
(
filesGroup
,
SWT
.
BORDER
|
SWT
.
FULL_SELECTION
);
filesTable
.
setHeaderVisible
(
true
);
filesTable
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
UIUtils
.
createTableColumn
(
filesTable
,
SWT
.
LEFT
,
"File"
);
for
(
DriverFileDescriptor
file
:
wizard
.
getFiles
())
{
new
TableItem
(
filesTable
,
SWT
.
NONE
).
setText
(
file
.
getPath
());
}
UIUtils
.
packColumns
(
filesTable
,
true
);
}
if
(!
wizard
.
isForceDownload
())
{
Label
infoText
=
new
Label
(
composite
,
SWT
.
NONE
);
infoText
.
setText
(
"\n\nOr you can obtain driver files by yourself and add them in driver editor."
);
infoText
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
}
createLinksPanel
(
composite
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadDialog.java
浏览文件 @
01ac41cd
...
...
@@ -21,6 +21,7 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import
org.eclipse.jface.wizard.WizardDialog
;
import
org.eclipse.swt.widgets.Button
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
...
...
@@ -28,6 +29,7 @@ import org.jkiss.dbeaver.registry.DriverDescriptor;
import
org.jkiss.dbeaver.registry.DriverFileDescriptor
;
import
org.jkiss.dbeaver.ui.DBeaverIcons
;
import
org.jkiss.dbeaver.ui.UIIcon
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
java.util.List
;
...
...
@@ -40,9 +42,9 @@ public class DriverDownloadDialog extends WizardDialog
private
boolean
doDownload
=
false
;
DriverDownloadDialog
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
DriverFileDescriptor
>
files
)
DriverDownloadDialog
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
DriverFileDescriptor
>
files
,
boolean
forceDownload
)
{
super
(
shell
,
new
DriverDownloadWizard
(
driver
,
files
));
super
(
shell
,
new
DriverDownloadWizard
(
driver
,
files
,
forceDownload
));
}
DriverDescriptor
getDriver
()
{
...
...
@@ -54,12 +56,27 @@ public class DriverDownloadDialog extends WizardDialog
return
(
DriverDownloadWizard
)
super
.
getWizard
();
}
@Override
protected
Control
createDialogArea
(
Composite
parent
)
{
Control
dialogArea
=
super
.
createDialogArea
(
parent
);
if
(
getWizard
().
isForceDownload
())
{
UIUtils
.
runInDetachedUI
(
getShell
(),
new
Runnable
()
{
@Override
public
void
run
()
{
buttonPressed
(
IDialogConstants
.
FINISH_ID
);
}
});
}
return
dialogArea
;
}
@Override
protected
void
createButtonsForButtonBar
(
Composite
parent
)
{
createButton
(
parent
,
EDIT_DRIVER_BUTTON_ID
,
"Edit Driver"
,
false
);
if
(!
getWizard
().
isForceDownload
())
{
createButton
(
parent
,
EDIT_DRIVER_BUTTON_ID
,
"Edit Driver"
,
false
);
}
super
.
createButtonsForButtonBar
(
parent
);
parent
.
layout
();
}
@Override
...
...
@@ -85,14 +102,20 @@ public class DriverDownloadDialog extends WizardDialog
@Override
protected
void
finishPressed
()
{
getButton
(
EDIT_DRIVER_BUTTON_ID
).
setEnabled
(
false
);
Button
editButton
=
getButton
(
EDIT_DRIVER_BUTTON_ID
);
if
(
editButton
!=
null
)
{
editButton
.
setEnabled
(
false
);
}
doDownload
=
true
;
super
.
finishPressed
();
}
public
static
boolean
downloadDriverFiles
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
DriverFileDescriptor
>
files
)
{
DriverDownloadDialog
dialog
=
new
DriverDownloadDialog
(
shell
,
driver
,
files
);
//dialog.setPageSize(1,1);
return
downloadDriverFiles
(
shell
,
driver
,
files
,
false
);
}
public
static
boolean
downloadDriverFiles
(
Shell
shell
,
DriverDescriptor
driver
,
List
<
DriverFileDescriptor
>
files
,
boolean
forceDownload
)
{
DriverDownloadDialog
dialog
=
new
DriverDownloadDialog
(
shell
,
driver
,
files
,
forceDownload
);
dialog
.
open
();
return
dialog
.
doDownload
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverDownloadWizard.java
浏览文件 @
01ac41cd
...
...
@@ -36,11 +36,13 @@ public class DriverDownloadWizard extends Wizard implements IExportWizard {
private
DriverDescriptor
driver
;
private
List
<
DriverFileDescriptor
>
files
;
private
boolean
forceDownload
;
private
DriverDownloadPage
downloadPage
;
public
DriverDownloadWizard
(
@NotNull
DriverDescriptor
driver
,
List
<
DriverFileDescriptor
>
files
)
{
public
DriverDownloadWizard
(
@NotNull
DriverDescriptor
driver
,
List
<
DriverFileDescriptor
>
files
,
boolean
forceDownload
)
{
this
.
driver
=
driver
;
this
.
files
=
files
;
this
.
forceDownload
=
forceDownload
;
setWindowTitle
(
"Setup driver files"
);
setNeedsProgressMonitor
(
hasPredefinedFiles
());
loadSettings
();
...
...
@@ -54,6 +56,10 @@ public class DriverDownloadWizard extends Wizard implements IExportWizard {
return
files
;
}
public
boolean
isForceDownload
()
{
return
forceDownload
;
}
private
void
loadSettings
()
{
IDialogSettings
section
=
UIUtils
.
getDialogSettings
(
DRIVER_DOWNLOAD_DIALOG_SETTINGS
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/driver/DriverEditDialog.java
浏览文件 @
01ac41cd
...
...
@@ -437,6 +437,14 @@ public class DriverEditDialog extends HelpEnabledDialog
}
});
updateVersionButton
=
UIUtils
.
createToolButton
(
libsControlGroup
,
CoreMessages
.
dialog_edit_driver_button_update_version
,
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
DriverFileDescriptor
selectedLib
=
getSelectedLibrary
();
updateArtifactVersion
(
selectedLib
);
}
});
deleteButton
=
UIUtils
.
createToolButton
(
libsControlGroup
,
CoreMessages
.
dialog_edit_driver_button_delete
,
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
...
...
@@ -483,13 +491,6 @@ public class DriverEditDialog extends HelpEnabledDialog
cpDialog
.
open
();
}
});
updateVersionButton
=
UIUtils
.
createToolButton
(
libsControlGroup
,
CoreMessages
.
dialog_edit_driver_button_update_version
,
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
DriverFileDescriptor
selectedLib
=
getSelectedLibrary
();
updateArtifactVersion
(
selectedLib
);
}
});
changeLibContent
();
...
...
@@ -500,7 +501,7 @@ public class DriverEditDialog extends HelpEnabledDialog
}
private
void
updateArtifactVersion
(
DriverFileDescriptor
lib
)
{
DriverDownloadDialog
.
downloadDriverFiles
(
getShell
(),
driver
,
Collections
.
singletonList
(
lib
),
true
);
}
private
void
createParametersTab
(
TabFolder
group
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录