Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
e88fa0b8
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,发现更多精彩内容 >>
提交
e88fa0b8
编写于
8月 07, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI model refactoring
上级
19a2b50e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
10 deletion
+27
-10
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
...ss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
+8
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseConsumerPageMapping.java
.../tools/transfer/database/DatabaseConsumerPageMapping.java
+2
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/handlers/DataImportHandler.java
...ss/dbeaver/tools/transfer/handlers/DataImportHandler.java
+2
-2
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/command/EntityAddCommand.java
...c/org/jkiss/dbeaver/ext/erd/command/EntityAddCommand.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugPanelFunction.java
...stgresql/debug/ui/internal/PostgreDebugPanelFunction.java
+4
-3
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/runtime/ui/DBPPlatformUI.java
...model/src/org/jkiss/dbeaver/runtime/ui/DBPPlatformUI.java
+3
-0
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/runtime/ui/DBUserInterface.java
...del/src/org/jkiss/dbeaver/runtime/ui/DBUserInterface.java
+6
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
浏览文件 @
e88fa0b8
...
...
@@ -35,6 +35,7 @@ import org.jkiss.dbeaver.model.DBPErrorAssistant;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.access.DBAAuthInfo
;
import
org.jkiss.dbeaver.model.access.DBAPasswordChangeInfo
;
import
org.jkiss.dbeaver.model.navigator.DBNNode
;
import
org.jkiss.dbeaver.model.runtime.DBRProcessDescriptor
;
import
org.jkiss.dbeaver.model.runtime.DBRProcessListener
;
import
org.jkiss.dbeaver.runtime.ui.DBPPlatformUI
;
...
...
@@ -43,6 +44,7 @@ import org.jkiss.dbeaver.ui.TrayIconHandler;
import
org.jkiss.dbeaver.ui.UITask
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.actions.datasource.DataSourceInvalidateHandler
;
import
org.jkiss.dbeaver.ui.dialogs.BrowseObjectDialog
;
import
org.jkiss.dbeaver.ui.dialogs.StandardErrorDialog
;
import
org.jkiss.dbeaver.ui.dialogs.connection.BaseAuthDialog
;
import
org.jkiss.dbeaver.ui.dialogs.connection.PasswordChangeDialog
;
...
...
@@ -262,6 +264,12 @@ public class DBeaverUI implements DBPPlatformUI {
}.
execute
();
}
@Override
public
DBNNode
selectObject
(
Object
parentShell
,
String
title
,
DBNNode
rootNode
,
DBNNode
selectedNode
,
Class
<?>[]
allowedTypes
,
Class
<?>[]
resultTypes
)
{
Shell
shell
=
(
parentShell
instanceof
Shell
?
(
Shell
)
parentShell
:
UIUtils
.
getActiveWorkbenchShell
());
return
BrowseObjectDialog
.
selectObject
(
shell
,
title
,
rootNode
,
selectedNode
,
allowedTypes
,
resultTypes
);
}
@Override
public
void
executeProcess
(
final
DBRProcessDescriptor
processDescriptor
)
{
processDescriptor
.
setProcessListener
(
new
DBRProcessListener
()
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseConsumerPageMapping.java
浏览文件 @
e88fa0b8
...
...
@@ -52,7 +52,6 @@ import org.jkiss.dbeaver.ui.UIUtils;
import
org.jkiss.dbeaver.ui.controls.CustomComboBoxCellEditor
;
import
org.jkiss.dbeaver.ui.controls.TreeContentProvider
;
import
org.jkiss.dbeaver.ui.dialogs.ActiveWizardPage
;
import
org.jkiss.dbeaver.ui.dialogs.BrowseObjectDialog
;
import
org.jkiss.dbeaver.ui.dialogs.EnterNameDialog
;
import
org.jkiss.dbeaver.ui.dialogs.sql.ViewSQLDialog
;
import
org.jkiss.dbeaver.ui.navigator.NavigatorUtils
;
...
...
@@ -141,7 +140,7 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
}
}
}
DBNNode
node
=
BrowseObjectDialog
.
selectObject
(
DBNNode
node
=
DBUserInterface
.
getInstance
()
.
selectObject
(
getShell
(),
"Choose container"
,
rootNode
.
getDatabases
(),
...
...
@@ -605,7 +604,7 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
if
(
mapping
.
getTarget
()
!=
null
)
{
selectedNode
=
NavigatorUtils
.
getNodeByObject
(
mapping
.
getTarget
());
}
DBNNode
node
=
BrowseObjectDialog
.
selectObject
(
DBNNode
node
=
DBUserInterface
.
getInstance
()
.
selectObject
(
getShell
(),
"Choose target table"
,
rootNode
,
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/handlers/DataImportHandler.java
浏览文件 @
e88fa0b8
...
...
@@ -28,12 +28,12 @@ import org.jkiss.dbeaver.model.struct.DBSDataContainer;
import
org.jkiss.dbeaver.model.struct.DBSDataManipulator
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.DBSObjectContainer
;
import
org.jkiss.dbeaver.runtime.ui.DBUserInterface
;
import
org.jkiss.dbeaver.tools.transfer.IDataTransferConsumer
;
import
org.jkiss.dbeaver.tools.transfer.IDataTransferNode
;
import
org.jkiss.dbeaver.tools.transfer.IDataTransferProducer
;
import
org.jkiss.dbeaver.tools.transfer.database.DatabaseTransferConsumer
;
import
org.jkiss.dbeaver.tools.transfer.database.DatabaseTransferProducer
;
import
org.jkiss.dbeaver.ui.dialogs.BrowseObjectDialog
;
import
org.jkiss.dbeaver.ui.navigator.NavigatorUtils
;
import
org.jkiss.dbeaver.utils.RuntimeUtils
;
...
...
@@ -58,7 +58,7 @@ public class DataImportHandler extends DataTransferHandler implements IElementUp
final
DBNModel
navigatorModel
=
DBeaverCore
.
getInstance
().
getNavigatorModel
();
final
DBNNode
rootNode
=
DBeaverCore
.
getInstance
().
getLiveProjects
().
size
()
==
1
?
navigatorModel
.
getRoot
().
getProject
(
DBeaverCore
.
getInstance
().
getProjectRegistry
().
getActiveProject
())
:
navigatorModel
.
getRoot
();
DBNNode
node
=
BrowseObjectDialog
.
selectObject
(
DBNNode
node
=
DBUserInterface
.
getInstance
()
.
selectObject
(
HandlerUtil
.
getActiveShell
(
event
),
"Select source container for '"
+
consumer
.
getTargetName
()
+
"'"
,
rootNode
,
...
...
plugins/org.jkiss.dbeaver.ext.erd/src/org/jkiss/dbeaver/ext/erd/command/EntityAddCommand.java
浏览文件 @
e88fa0b8
...
...
@@ -31,8 +31,8 @@ import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import
org.jkiss.dbeaver.model.struct.DBSEntity
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.rdb.DBSTable
;
import
org.jkiss.dbeaver.runtime.ui.DBUserInterface
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.dialogs.BrowseObjectDialog
;
import
org.jkiss.dbeaver.ui.navigator.NavigatorUtils
;
import
java.util.List
;
...
...
@@ -72,7 +72,7 @@ public class EntityAddCommand extends Command
DBSObject
selectedObject
=
DBUtils
.
getSelectedObject
(
entity
.
getDataSource
(),
true
);
DBNDatabaseNode
dsNode
=
NavigatorUtils
.
getNodeByObject
(
selectedObject
!=
null
?
selectedObject
:
entity
.
getDataSource
().
getContainer
());
if
(
dsNode
!=
null
)
{
DBNNode
tableNode
=
BrowseObjectDialog
.
selectObject
(
DBNNode
tableNode
=
DBUserInterface
.
getInstance
()
.
selectObject
(
UIUtils
.
getActiveWorkbenchShell
(),
"Select a table"
,
dsNode
,
...
...
plugins/org.jkiss.dbeaver.ext.postgresql.debug.ui/src/org/jkiss/dbeaver/ext/postgresql/debug/ui/internal/PostgreDebugPanelFunction.java
浏览文件 @
e88fa0b8
...
...
@@ -32,7 +32,8 @@ import org.jkiss.dbeaver.debug.ui.DBGConfigurationPanel;
import
org.jkiss.dbeaver.debug.ui.DBGConfigurationPanelContainer
;
import
org.jkiss.dbeaver.ext.postgresql.debug.PostgreDebugConstants
;
import
org.jkiss.dbeaver.ext.postgresql.debug.core.PostgreSqlDebugCore
;
import
org.jkiss.dbeaver.ext.postgresql.model.*
;
import
org.jkiss.dbeaver.ext.postgresql.model.PostgreProcedure
;
import
org.jkiss.dbeaver.ext.postgresql.model.PostgreProcedureParameter
;
import
org.jkiss.dbeaver.model.DBIcon
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode
;
...
...
@@ -41,12 +42,12 @@ import org.jkiss.dbeaver.model.navigator.DBNNode;
import
org.jkiss.dbeaver.model.struct.DBSInstance
;
import
org.jkiss.dbeaver.model.struct.DBSObjectContainer
;
import
org.jkiss.dbeaver.model.struct.rdb.DBSProcedureParameter
;
import
org.jkiss.dbeaver.runtime.ui.DBUserInterface
;
import
org.jkiss.dbeaver.ui.DBeaverIcons
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.controls.CSmartCombo
;
import
org.jkiss.dbeaver.ui.controls.CSmartSelector
;
import
org.jkiss.dbeaver.ui.controls.CustomTableEditor
;
import
org.jkiss.dbeaver.ui.dialogs.BrowseObjectDialog
;
import
org.jkiss.utils.CommonUtils
;
import
java.lang.reflect.InvocationTargetException
;
...
...
@@ -118,7 +119,7 @@ public class PostgreDebugPanelFunction implements DBGConfigurationPanel {
DBNDatabaseNode
dsNode
=
navigatorModel
.
getNodeByObject
(
container
.
getDataSource
());
if
(
dsNode
!=
null
)
{
DBNNode
curNode
=
selectedFunction
==
null
?
null
:
navigatorModel
.
getNodeByObject
(
selectedFunction
);
DBNNode
node
=
BrowseObjectDialog
.
selectObject
(
DBNNode
node
=
DBUserInterface
.
getInstance
()
.
selectObject
(
parent
.
getShell
(),
"Select function to debug"
,
dsNode
,
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/runtime/ui/DBPPlatformUI.java
浏览文件 @
e88fa0b8
...
...
@@ -22,6 +22,7 @@ import org.jkiss.code.NotNull;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.access.DBAAuthInfo
;
import
org.jkiss.dbeaver.model.access.DBAPasswordChangeInfo
;
import
org.jkiss.dbeaver.model.navigator.DBNNode
;
import
org.jkiss.dbeaver.model.runtime.DBRProcessDescriptor
;
/**
...
...
@@ -51,6 +52,8 @@ public interface DBPPlatformUI {
*/
DBAPasswordChangeInfo
promptUserPasswordChange
(
String
prompt
,
@Nullable
String
userName
,
@Nullable
String
oldPassword
);
DBNNode
selectObject
(
Object
parentShell
,
String
title
,
DBNNode
rootNode
,
DBNNode
selectedNode
,
Class
<?>[]
allowedTypes
,
Class
<?>[]
resultTypes
);
void
executeProcess
(
DBRProcessDescriptor
processDescriptor
);
void
executeInUI
(
Runnable
runnable
);
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/runtime/ui/DBUserInterface.java
浏览文件 @
e88fa0b8
...
...
@@ -23,6 +23,7 @@ import org.jkiss.code.Nullable;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.access.DBAAuthInfo
;
import
org.jkiss.dbeaver.model.access.DBAPasswordChangeInfo
;
import
org.jkiss.dbeaver.model.navigator.DBNNode
;
import
org.jkiss.dbeaver.model.runtime.DBRProcessDescriptor
;
/**
...
...
@@ -72,6 +73,11 @@ public class DBUserInterface {
return
null
;
}
@Override
public
DBNNode
selectObject
(
Object
parentShell
,
String
title
,
DBNNode
rootNode
,
DBNNode
selectedNode
,
Class
<?>[]
allowedTypes
,
Class
<?>[]
resultTypes
)
{
return
null
;
}
@Override
public
void
executeProcess
(
DBRProcessDescriptor
processDescriptor
)
{
try
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录