Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
e685b6f0
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,发现更多精彩内容 >>
提交
e685b6f0
编写于
4月 21, 2019
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#5716 Native client selector in tool wizards dialog
上级
bc217fa0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
107 addition
and
9 deletion
+107
-9
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/CoreResources.properties
....core/src/org/jkiss/dbeaver/core/CoreResources.properties
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/tools/AbstractToolWizard.java
...rg/jkiss/dbeaver/ui/dialogs/tools/AbstractToolWizard.java
+20
-6
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/tools/ToolWizardDialog.java
.../org/jkiss/dbeaver/ui/dialogs/tools/ToolWizardDialog.java
+80
-0
plugins/org.jkiss.dbeaver.ext.mockdata/src/org/jkiss/dbeaver/ext/mockdata/MockDataExecuteWizard.java
...org/jkiss/dbeaver/ext/mockdata/MockDataExecuteWizard.java
+5
-1
plugins/org.jkiss.dbeaver.ext.postgresql.ui/src/org/jkiss/dbeaver/ext/postgresql/PostgresResources.properties
...jkiss/dbeaver/ext/postgresql/PostgresResources.properties
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/CoreResources.properties
浏览文件 @
e685b6f0
...
@@ -474,7 +474,7 @@ tools_wizard_error_task_error_title = {0} error
...
@@ -474,7 +474,7 @@ tools_wizard_error_task_error_title = {0} error
tools_wizard_log_io_error
=
IO Error: {0}
tools_wizard_log_io_error
=
IO Error: {0}
tools_wizard_log_process_exit_code
=
Process exit code: {0}
tools_wizard_log_process_exit_code
=
Process exit code: {0}
tools_wizard_message_client_home_not_found
=
Client home "{0}" not found
tools_wizard_message_client_home_not_found
=
Client home "{0}" not found
tools_wizard_message_no_client_home
=
Client home
is not specified for connection
tools_wizard_message_no_client_home
=
Native client
is not specified for connection
tools_wizard_page_log_task_finished
=
{0} finished at {1}
tools_wizard_page_log_task_finished
=
{0} finished at {1}
tools_wizard_page_log_task_log_reader
=
{0} log reader
tools_wizard_page_log_task_log_reader
=
{0} log reader
tools_wizard_page_log_task_progress
=
{0} progress
tools_wizard_page_log_task_progress
=
{0} progress
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/tools/AbstractToolWizard.java
浏览文件 @
e685b6f0
...
@@ -30,7 +30,6 @@ import org.jkiss.dbeaver.Log;
...
@@ -30,7 +30,6 @@ import org.jkiss.dbeaver.Log;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.runtime.DBWorkbench
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.model.connection.DBPNativeClientLocation
;
import
org.jkiss.dbeaver.model.connection.DBPNativeClientLocation
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode
;
...
@@ -38,6 +37,7 @@ import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
...
@@ -38,6 +37,7 @@ import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.runtime.DBWorkbench
;
import
org.jkiss.dbeaver.runtime.ProgressStreamReader
;
import
org.jkiss.dbeaver.runtime.ProgressStreamReader
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.CommonUtils
;
...
@@ -68,7 +68,6 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
...
@@ -68,7 +68,6 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
private
String
toolUserName
;
private
String
toolUserName
;
private
String
toolUserPassword
;
private
String
toolUserPassword
;
private
String
extraCommandArgs
;
private
String
extraCommandArgs
;
protected
boolean
nativeClientHomeRequired
=
true
;
protected
String
task
;
protected
String
task
;
protected
final
DatabaseWizardPageLog
logPage
;
protected
final
DatabaseWizardPageLog
logPage
;
...
@@ -171,6 +170,10 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
...
@@ -171,6 +170,10 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
}
}
}
}
public
DBPDataSourceContainer
getDataSourceContainer
()
{
return
dataSourceContainer
;
}
public
DBPNativeClientLocation
findNativeClientHome
(
String
clientHomeId
)
{
public
DBPNativeClientLocation
findNativeClientHome
(
String
clientHomeId
)
{
return
null
;
return
null
;
}
}
...
@@ -182,11 +185,16 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
...
@@ -182,11 +185,16 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
{
{
super
.
createPageControls
(
pageContainer
);
super
.
createPageControls
(
pageContainer
);
updateErrorMessage
();
}
public
void
updateErrorMessage
()
{
WizardPage
currentPage
=
(
WizardPage
)
getStartingPage
();
WizardPage
currentPage
=
(
WizardPage
)
getStartingPage
();
if
(
nativeClientHomeRequired
)
{
if
(
isNativeClientHomeRequired
()
)
{
String
clientHomeId
=
connectionInfo
.
getClientHomeId
();
String
clientHomeId
=
dataSourceContainer
.
getConnectionConfiguration
()
.
getClientHomeId
();
if
(
clientHomeId
==
null
)
{
if
(
clientHomeId
==
null
)
{
clientHome
=
null
;
currentPage
.
setErrorMessage
(
CoreMessages
.
tools_wizard_message_no_client_home
);
currentPage
.
setErrorMessage
(
CoreMessages
.
tools_wizard_message_no_client_home
);
getContainer
().
updateMessage
();
getContainer
().
updateMessage
();
return
;
return
;
...
@@ -197,13 +205,15 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
...
@@ -197,13 +205,15 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
}
}
if
(
clientHome
==
null
)
{
if
(
clientHome
==
null
)
{
currentPage
.
setErrorMessage
(
NLS
.
bind
(
CoreMessages
.
tools_wizard_message_client_home_not_found
,
clientHomeId
));
currentPage
.
setErrorMessage
(
NLS
.
bind
(
CoreMessages
.
tools_wizard_message_client_home_not_found
,
clientHomeId
));
getContainer
().
updateMessage
();
}
else
{
currentPage
.
setErrorMessage
(
null
);
}
}
getContainer
().
updateMessage
();
}
}
}
}
private
boolean
validateClientFiles
()
{
private
boolean
validateClientFiles
()
{
if
(!
nativeClientHomeRequired
||
clientHome
==
null
)
{
if
(!
isNativeClientHomeRequired
()
||
clientHome
==
null
)
{
return
true
;
return
true
;
}
}
try
{
try
{
...
@@ -364,6 +374,10 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
...
@@ -364,6 +374,10 @@ public abstract class AbstractToolWizard<BASE_OBJECT extends DBSObject, PROCESS_
return
true
;
return
true
;
}
}
protected
boolean
isNativeClientHomeRequired
()
{
return
true
;
}
protected
boolean
isMergeProcessStreams
()
protected
boolean
isMergeProcessStreams
()
{
{
return
false
;
return
false
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/tools/ToolWizardDialog.java
浏览文件 @
e685b6f0
...
@@ -21,17 +21,29 @@ package org.jkiss.dbeaver.ui.dialogs.tools;
...
@@ -21,17 +21,29 @@ package org.jkiss.dbeaver.ui.dialogs.tools;
import
org.eclipse.jface.dialogs.IDialogConstants
;
import
org.eclipse.jface.dialogs.IDialogConstants
;
import
org.eclipse.jface.wizard.IWizard
;
import
org.eclipse.jface.wizard.IWizard
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Button
;
import
org.eclipse.swt.widgets.Button
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Label
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.DBPImage
;
import
org.jkiss.dbeaver.ui.dialogs.ActiveWizardDialog
;
import
org.jkiss.dbeaver.ui.dialogs.ActiveWizardDialog
;
import
org.jkiss.dbeaver.ui.dialogs.BaseDialog
;
import
org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesPanel
;
import
org.jkiss.dbeaver.ui.dialogs.connection.ClientHomesSelector
;
/**
/**
* Tool wizard dialog
* Tool wizard dialog
*/
*/
public
class
ToolWizardDialog
extends
ActiveWizardDialog
public
class
ToolWizardDialog
extends
ActiveWizardDialog
{
{
public
static
final
int
CLIENT_CONFIG_ID
=
1000
;
public
ToolWizardDialog
(
IWorkbenchWindow
window
,
IWizard
wizard
)
public
ToolWizardDialog
(
IWorkbenchWindow
window
,
IWizard
wizard
)
{
{
super
(
window
,
wizard
);
super
(
window
,
wizard
);
...
@@ -42,10 +54,78 @@ public class ToolWizardDialog extends ActiveWizardDialog
...
@@ -42,10 +54,78 @@ public class ToolWizardDialog extends ActiveWizardDialog
@Override
@Override
protected
void
createButtonsForButtonBar
(
Composite
parent
)
protected
void
createButtonsForButtonBar
(
Composite
parent
)
{
{
if
(
getWizard
()
instanceof
AbstractToolWizard
<?,
?>)
{
boolean
nativeClientRequired
=
((
AbstractToolWizard
)
getWizard
()).
isNativeClientHomeRequired
();
if
(
nativeClientRequired
)
{
parent
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
true
,
false
));
Button
configButton
=
createButton
(
parent
,
CLIENT_CONFIG_ID
,
" Client configuration ... "
,
false
);
configButton
.
setLayoutData
(
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_BEGINNING
));
Label
spacer
=
new
Label
(
parent
,
SWT
.
NONE
);
spacer
.
setLayoutData
(
new
GridData
(
SWT
.
FILL
,
SWT
.
CENTER
,
true
,
false
));
((
GridLayout
)
parent
.
getLayout
()).
numColumns
++;
((
GridLayout
)
parent
.
getLayout
()).
makeColumnsEqualWidth
=
false
;
}
}
super
.
createButtonsForButtonBar
(
parent
);
super
.
createButtonsForButtonBar
(
parent
);
Button
cancelButton
=
getButton
(
IDialogConstants
.
CANCEL_ID
);
Button
cancelButton
=
getButton
(
IDialogConstants
.
CANCEL_ID
);
cancelButton
.
setText
(
IDialogConstants
.
CLOSE_LABEL
);
cancelButton
.
setText
(
IDialogConstants
.
CLOSE_LABEL
);
Button
finishButton
=
getButton
(
IDialogConstants
.
FINISH_ID
);
Button
finishButton
=
getButton
(
IDialogConstants
.
FINISH_ID
);
finishButton
.
setText
(
CoreMessages
.
tools_wizard_dialog_button_start
);
finishButton
.
setText
(
CoreMessages
.
tools_wizard_dialog_button_start
);
}
}
@Override
protected
void
buttonPressed
(
int
buttonId
)
{
if
(
buttonId
==
CLIENT_CONFIG_ID
)
{
openClientConfiguration
();
}
super
.
buttonPressed
(
buttonId
);
}
private
void
openClientConfiguration
()
{
AbstractToolWizard
toolWizard
=
(
AbstractToolWizard
)
getWizard
();
DBPDataSourceContainer
dataSource
=
toolWizard
.
getDataSourceContainer
();
if
(
dataSource
!=
null
)
{
NativeClientConfigDialog
dialog
=
new
NativeClientConfigDialog
(
getShell
(),
dataSource
);
if
(
dialog
.
open
()
==
IDialogConstants
.
OK_ID
)
{
toolWizard
.
updateErrorMessage
();
updateButtons
();
}
}
}
private
static
class
NativeClientConfigDialog
extends
BaseDialog
{
private
final
DBPDataSourceContainer
dataSource
;
private
ClientHomesSelector
homesSelector
;
public
NativeClientConfigDialog
(
Shell
parentShell
,
DBPDataSourceContainer
dataSource
)
{
super
(
parentShell
,
"Configure local client for "
+
dataSource
.
getName
(),
dataSource
.
getDriver
().
getIcon
());
this
.
dataSource
=
dataSource
;
}
@Override
protected
Composite
createDialogArea
(
Composite
parent
)
{
Composite
dialogArea
=
super
.
createDialogArea
(
parent
);
homesSelector
=
new
ClientHomesSelector
(
dialogArea
,
SWT
.
NONE
,
"Native client"
);
homesSelector
.
populateHomes
(
dataSource
.
getDriver
(),
dataSource
.
getConnectionConfiguration
().
getClientHomeId
(),
false
);
homesSelector
.
getPanel
().
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
return
dialogArea
;
}
@Override
protected
void
okPressed
()
{
String
selectedHome
=
homesSelector
.
getSelectedHome
();
dataSource
.
getConnectionConfiguration
().
setClientHomeId
(
selectedHome
);
dataSource
.
getRegistry
().
flushConfig
();
super
.
okPressed
();
}
}
}
}
plugins/org.jkiss.dbeaver.ext.mockdata/src/org/jkiss/dbeaver/ext/mockdata/MockDataExecuteWizard.java
浏览文件 @
e685b6f0
...
@@ -57,7 +57,6 @@ public class MockDataExecuteWizard extends AbstractToolWizard<DBSDataManipulato
...
@@ -57,7 +57,6 @@ public class MockDataExecuteWizard extends AbstractToolWizard<DBSDataManipulato
MockDataExecuteWizard
(
MockDataSettings
mockDataSettings
,
Collection
<
DBSDataManipulator
>
dbObjects
,
String
task
)
{
MockDataExecuteWizard
(
MockDataSettings
mockDataSettings
,
Collection
<
DBSDataManipulator
>
dbObjects
,
String
task
)
{
super
(
dbObjects
,
task
);
super
(
dbObjects
,
task
);
this
.
nativeClientHomeRequired
=
false
;
this
.
mockDataSettings
=
mockDataSettings
;
this
.
mockDataSettings
=
mockDataSettings
;
setDialogSettings
(
setDialogSettings
(
...
@@ -66,6 +65,11 @@ public class MockDataExecuteWizard extends AbstractToolWizard<DBSDataManipulato
...
@@ -66,6 +65,11 @@ public class MockDataExecuteWizard extends AbstractToolWizard<DBSDataManipulato
WIZARD_DIALOG_SETTINGS
));
WIZARD_DIALOG_SETTINGS
));
}
}
@Override
protected
boolean
isNativeClientHomeRequired
()
{
return
false
;
}
@Override
@Override
public
void
init
(
IWorkbench
workbench
,
IStructuredSelection
selection
)
{
public
void
init
(
IWorkbench
workbench
,
IStructuredSelection
selection
)
{
setWindowTitle
(
task
);
setWindowTitle
(
task
);
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.ui/src/org/jkiss/dbeaver/ext/postgresql/PostgresResources.properties
浏览文件 @
e685b6f0
...
@@ -120,7 +120,7 @@ dialog_setting_connection_localClient = Local Client
...
@@ -120,7 +120,7 @@ dialog_setting_connection_localClient = Local Client
dialog_setting_connection_nondefaultDatabase
=
Show all databases
dialog_setting_connection_nondefaultDatabase
=
Show all databases
dialog_setting_connection_nondefaultDatabase_tip
=
Show all databases in database navigator.
\n
If not set then only one database will be visible
dialog_setting_connection_nondefaultDatabase_tip
=
Show all databases in database navigator.
\n
If not set then only one database will be visible
dialog_setting_connection_show_templates
=
Show template databases
dialog_setting_connection_show_templates
=
Show template databases
dialog_setting_connection_show_templates_tip
=
Show t
a
mplate databases in database list.
\n
Enabled only if non-default databases are visible
dialog_setting_connection_show_templates_tip
=
Show t
e
mplate databases in database list.
\n
Enabled only if non-default databases are visible
dialog_setting_connection_switchDatabaseOnExpand
=
Switch default database on access
dialog_setting_connection_switchDatabaseOnExpand
=
Switch default database on access
dialog_setting_connection_switchDatabaseOnExpand_tip
=
Switch default database if you access any object inside non-default database (e.g. schema)
dialog_setting_connection_switchDatabaseOnExpand_tip
=
Switch default database if you access any object inside non-default database (e.g. schema)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录