Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
530fc3ef
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,发现更多精彩内容 >>
提交
530fc3ef
编写于
3月 07, 2021
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/devel' into devel
上级
d15beabf
9eed6897
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
84 addition
and
23 deletion
+84
-23
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
...ss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
+13
-1
plugins/org.jkiss.dbeaver.erd.model/src/org/jkiss/dbeaver/erd/model/DiagramObjectCollector.java
...c/org/jkiss/dbeaver/erd/model/DiagramObjectCollector.java
+7
-2
plugins/org.jkiss.dbeaver.erd.model/src/org/jkiss/dbeaver/erd/model/ERDUtils.java
...r.erd.model/src/org/jkiss/dbeaver/erd/model/ERDUtils.java
+6
-2
plugins/org.jkiss.dbeaver.ext.teradata/src/org/jkiss/dbeaver/ext/teradata/model/TeradataMetaModel.java
...g/jkiss/dbeaver/ext/teradata/model/TeradataMetaModel.java
+5
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
...g/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
+4
-2
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/runtime/ui/DBPPlatformUI.java
...model/src/org/jkiss/dbeaver/runtime/ui/DBPPlatformUI.java
+2
-0
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/runtime/ui/console/ConsoleUserInterface.java
...kiss/dbeaver/runtime/ui/console/ConsoleUserInterface.java
+5
-0
plugins/org.jkiss.dbeaver.registry/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
...ry/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
+1
-1
plugins/org.jkiss.dbeaver.ui.editors.connection/src/org/jkiss/dbeaver/ui/dialogs/BaseAuthDialog.java
...tion/src/org/jkiss/dbeaver/ui/dialogs/BaseAuthDialog.java
+12
-2
plugins/org.jkiss.dbeaver.ui.editors.connection/src/org/jkiss/dbeaver/ui/dialogs/connection/ProjectSelectorPanel.java
...s/dbeaver/ui/dialogs/connection/ProjectSelectorPanel.java
+5
-4
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/NavigatorUtils.java
...or/src/org/jkiss/dbeaver/ui/navigator/NavigatorUtils.java
+9
-1
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/actions/NavigatorHandlerObjectDelete.java
...er/ui/navigator/actions/NavigatorHandlerObjectDelete.java
+14
-6
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/database/DatabaseNavigatorContent.java
...eaver/ui/navigator/database/DatabaseNavigatorContent.java
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
浏览文件 @
530fc3ef
...
...
@@ -64,6 +64,7 @@ import org.jkiss.dbeaver.ui.dialogs.connection.PasswordChangeDialog;
import
org.jkiss.dbeaver.ui.dialogs.driver.DriverDownloadDialog
;
import
org.jkiss.dbeaver.ui.dialogs.driver.DriverEditDialog
;
import
org.jkiss.dbeaver.ui.dialogs.exec.ExecutionQueueErrorJob
;
import
org.jkiss.dbeaver.ui.internal.UIConnectionMessages
;
import
org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectOpen
;
import
org.jkiss.dbeaver.ui.navigator.dialogs.ObjectBrowserDialog
;
import
org.jkiss.dbeaver.ui.views.process.ProcessPropertyTester
;
...
...
@@ -283,13 +284,24 @@ public class DBeaverUI implements DBPPlatformUI {
@Override
public
DBPAuthInfo
promptUserCredentials
(
final
String
prompt
,
final
String
userName
,
final
String
userPassword
,
final
boolean
passwordOnly
,
boolean
showSavePassword
)
{
return
promptUserCredentials
(
prompt
,
UIConnectionMessages
.
dialog_connection_auth_label_username
,
userName
,
UIConnectionMessages
.
dialog_connection_auth_label_password
,
userPassword
,
passwordOnly
,
showSavePassword
);
}
// Ask user
@Override
public
DBPAuthInfo
promptUserCredentials
(
String
prompt
,
String
userNameLabel
,
String
userName
,
String
passwordLabel
,
String
userPassword
,
boolean
passwordOnly
,
boolean
showSavePassword
)
{
return
new
UITask
<
DBPAuthInfo
>()
{
@Override
public
DBPAuthInfo
runTask
()
{
final
Shell
shell
=
UIUtils
.
getActiveWorkbenchShell
();
final
BaseAuthDialog
authDialog
=
new
BaseAuthDialog
(
shell
,
prompt
,
passwordOnly
,
showSavePassword
);
authDialog
.
setUserNameLabel
(
userNameLabel
);
authDialog
.
setPasswordLabel
(
passwordLabel
);
if
(!
passwordOnly
)
{
authDialog
.
setUserName
(
userName
);
}
...
...
plugins/org.jkiss.dbeaver.erd.model/src/org/jkiss/dbeaver/erd/model/DiagramObjectCollector.java
浏览文件 @
530fc3ef
...
...
@@ -120,11 +120,16 @@ public class DiagramObjectCollector {
continue
;
}
if
(
entity
instanceof
DBSEntity
)
{
if
((
entity
instanceof
DBSTablePartition
&&
!
showPartitions
)
||
(
DBUtils
.
isView
((
DBSEntity
)
entity
)
&&
!
showViews
))
{
DBSEntity
entity1
=
(
DBSEntity
)
entity
;
if
((
entity
instanceof
DBSTablePartition
&&
!
showPartitions
)
||
(
DBUtils
.
isView
(
entity1
)
&&
!
showViews
))
{
continue
;
}
tables
.
add
((
DBSEntity
)
entity
);
if
(
ERDUtils
.
skipSystemEntity
(
entity1
))
{
continue
;
}
tables
.
add
(
entity1
);
}
else
if
(
entity
instanceof
DBSObjectContainer
)
{
collectTables
(
monitor
,
(
DBSObjectContainer
)
entity
,
tables
,
showViews
,
showPartitions
);
}
...
...
plugins/org.jkiss.dbeaver.erd.model/src/org/jkiss/dbeaver/erd/model/ERDUtils.java
浏览文件 @
530fc3ef
...
...
@@ -159,8 +159,7 @@ public class ERDUtils
final
DBSEntity
entity1
=
(
DBSEntity
)
entity
;
boolean
showSystemObjects
=
entity1
.
getDataSource
().
getContainer
().
getNavigatorSettings
().
isShowSystemObjects
();
if
(!
showSystemObjects
&&
entity1
instanceof
DBPSystemObject
&&
((
DBPSystemObject
)
entity1
).
isSystem
())
{
if
(
skipSystemEntity
(
entity1
))
{
continue
;
}
...
...
@@ -246,4 +245,9 @@ public class ERDUtils
return
result
;
}
public
static
boolean
skipSystemEntity
(
DBSEntity
entity
)
{
boolean
showSystemObjects
=
entity
.
getDataSource
().
getContainer
().
getNavigatorSettings
().
isShowSystemObjects
();
return
!
showSystemObjects
&&
entity
instanceof
DBPSystemObject
&&
((
DBPSystemObject
)
entity
).
isSystem
();
}
}
plugins/org.jkiss.dbeaver.ext.teradata/src/org/jkiss/dbeaver/ext/teradata/model/TeradataMetaModel.java
浏览文件 @
530fc3ef
...
...
@@ -57,7 +57,11 @@ public class TeradataMetaModel extends GenericMetaModel implements DBDValueHandl
@Override
public
GenericTableBase
createTableImpl
(
GenericStructContainer
container
,
@Nullable
String
tableName
,
@Nullable
String
tableType
,
@Nullable
JDBCResultSet
dbResult
)
{
return
new
TeradataTable
(
container
,
tableName
,
tableType
,
dbResult
);
if
(
tableType
!=
null
&&
isView
(
tableType
))
{
return
new
GenericView
(
container
,
tableName
,
tableType
,
dbResult
);
}
else
{
return
new
TeradataTable
(
container
,
tableName
,
tableType
,
dbResult
);
}
}
@Override
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
浏览文件 @
530fc3ef
...
...
@@ -245,12 +245,14 @@ public class JDBCExecutionContext extends AbstractExecutionContext<JDBCDataSourc
}
private
void
closeContext
(
boolean
removeContext
)
{
disconnect
();
// We remove context before it is actually closed.
// Because disconnect may (potentially) hang in socket forever
if
(
removeContext
)
{
// Remove self from context list
this
.
instance
.
removeContext
(
this
);
}
disconnect
();
}
//////////////////////////////////////////////////////////////
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/runtime/ui/DBPPlatformUI.java
浏览文件 @
530fc3ef
...
...
@@ -73,6 +73,8 @@ public interface DBPPlatformUI {
*/
DBPAuthInfo
promptUserCredentials
(
String
prompt
,
String
userName
,
String
userPassword
,
boolean
passwordOnly
,
boolean
showSavePassword
);
DBPAuthInfo
promptUserCredentials
(
String
prompt
,
String
userNameLabel
,
String
userName
,
String
passwordLabel
,
String
userPassword
,
boolean
passwordOnly
,
boolean
showSavePassword
);
/**
* Asks for password change. Returns null if user canceled this action.
*/
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/runtime/ui/console/ConsoleUserInterface.java
浏览文件 @
530fc3ef
...
...
@@ -111,6 +111,11 @@ public class ConsoleUserInterface implements DBPPlatformUI {
throw
new
IllegalStateException
(
"Can not prompt user credentials in non-interactive mode"
);
}
@Override
public
DBPAuthInfo
promptUserCredentials
(
String
prompt
,
String
userNameLabel
,
String
userName
,
String
passwordLabel
,
String
userPassword
,
boolean
passwordOnly
,
boolean
showSavePassword
)
{
throw
new
IllegalStateException
(
"Can not prompt user credentials in non-interactive mode"
);
}
@Override
public
DBAPasswordChangeInfo
promptUserPasswordChange
(
String
prompt
,
String
userName
,
String
oldPassword
)
{
throw
new
IllegalStateException
(
"Can not prompt user password change in non-interactive mode"
);
...
...
plugins/org.jkiss.dbeaver.registry/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
浏览文件 @
530fc3ef
...
...
@@ -200,7 +200,7 @@ public class DataSourceRegistry implements DBPDataSourceRegistry {
public
DataSourceDescriptor
findDataSourceByName
(
String
name
)
{
synchronized
(
dataSources
)
{
for
(
DataSourceDescriptor
dsd
:
dataSources
.
values
())
{
if
(
dsd
.
getName
().
equals
(
name
))
{
if
(
!
dsd
.
isHidden
()
&&
dsd
.
getName
().
equals
(
name
))
{
return
dsd
;
}
}
...
...
plugins/org.jkiss.dbeaver.ui.editors.connection/src/org/jkiss/dbeaver/ui/dialogs/BaseAuthDialog.java
浏览文件 @
530fc3ef
...
...
@@ -34,6 +34,8 @@ public class BaseAuthDialog extends BaseDialog implements BlockingPopupDialog
{
private
static
final
String
DIALOG_ID
=
"DBeaver.BaseAuthDialog"
;
//$NON-NLS-1$
private
String
userNameLabel
=
UIConnectionMessages
.
dialog_connection_auth_label_username
;
private
String
passwordLabel
=
UIConnectionMessages
.
dialog_connection_auth_label_password
;
private
boolean
passwordOnly
;
private
boolean
showSavePassword
;
private
DBPAuthInfo
authInfo
=
new
DBPAuthInfo
();
...
...
@@ -56,6 +58,14 @@ public class BaseAuthDialog extends BaseDialog implements BlockingPopupDialog
return
UIUtils
.
getDialogSettings
(
DIALOG_ID
);
}
public
void
setUserNameLabel
(
String
userNameLabel
)
{
this
.
userNameLabel
=
userNameLabel
;
}
public
void
setPasswordLabel
(
String
passwordLabel
)
{
this
.
passwordLabel
=
passwordLabel
;
}
public
DBPAuthInfo
getAuthInfo
()
{
return
authInfo
;
...
...
@@ -123,7 +133,7 @@ public class BaseAuthDialog extends BaseDialog implements BlockingPopupDialog
credGroup
.
setLayoutData
(
gd
);
if
(!
passwordOnly
)
{
Label
usernameLabel
=
new
Label
(
credGroup
,
SWT
.
NONE
);
usernameLabel
.
setText
(
UIConnectionMessages
.
dialog_connection_auth_label_username
);
usernameLabel
.
setText
(
this
.
userNameLabel
);
usernameLabel
.
setLayoutData
(
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
));
usernameText
=
new
Text
(
credGroup
,
SWT
.
BORDER
);
...
...
@@ -138,7 +148,7 @@ public class BaseAuthDialog extends BaseDialog implements BlockingPopupDialog
}
Label
passwordLabel
=
new
Label
(
credGroup
,
SWT
.
NONE
);
passwordLabel
.
setText
(
UIConnectionMessages
.
dialog_connection_auth_label_password
);
passwordLabel
.
setText
(
this
.
passwordLabel
);
passwordLabel
.
setLayoutData
(
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
));
passwordText
=
new
Text
(
credGroup
,
SWT
.
BORDER
|
SWT
.
PASSWORD
);
...
...
plugins/org.jkiss.dbeaver.ui.editors.connection/src/org/jkiss/dbeaver/ui/dialogs/connection/ProjectSelectorPanel.java
浏览文件 @
530fc3ef
...
...
@@ -69,11 +69,12 @@ public class ProjectSelectorPanel {
}
if
(
selectedProject
==
null
)
{
projectCombo
.
select
(
0
);
selectedProject
=
projects
.
get
(
0
);
}
else
{
projectCombo
.
setText
(
selectedProject
.
getName
());
selectedProject
=
DBWorkbench
.
getPlatform
().
getWorkspace
().
getActiveProject
(
);
if
(!
projects
.
contains
(
selectedProject
))
{
selectedProject
=
projects
.
get
(
0
);
}
}
projectCombo
.
setText
(
selectedProject
.
getName
());
projectCombo
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/NavigatorUtils.java
浏览文件 @
530fc3ef
...
...
@@ -57,6 +57,7 @@ import org.jkiss.dbeaver.ui.dnd.TreeNodeTransfer;
import
org.jkiss.dbeaver.ui.editors.MultiPageDatabaseEditor
;
import
org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerObjectOpen
;
import
org.jkiss.dbeaver.ui.navigator.actions.NavigatorHandlerRefresh
;
import
org.jkiss.dbeaver.ui.navigator.database.DatabaseNavigatorContent
;
import
org.jkiss.dbeaver.ui.navigator.database.DatabaseNavigatorView
;
import
org.jkiss.dbeaver.ui.navigator.database.NavigatorViewBase
;
import
org.jkiss.dbeaver.ui.navigator.project.ProjectNavigatorView
;
...
...
@@ -493,7 +494,14 @@ public class NavigatorUtils {
}
else
if
(
curObject
==
null
)
{
for
(
DBNNode
node
:
TreeNodeTransfer
.
getInstance
().
getObject
())
{
if
(
node
instanceof
DBNDataSource
)
{
((
DBNDataSource
)
node
).
moveToFolder
(
node
.
getOwnerProject
(),
null
);
// Drop datasource on a view
// We need target project
if
(
viewer
.
getInput
()
instanceof
DatabaseNavigatorContent
)
{
DBNNode
rootNode
=
((
DatabaseNavigatorContent
)
viewer
.
getInput
()).
getRootNode
();
if
(
rootNode
!=
null
&&
rootNode
.
getOwnerProject
()
!=
null
)
{
((
DBNDataSource
)
node
).
moveToFolder
(
rootNode
.
getOwnerProject
(),
null
);
}
}
}
else
if
(
node
instanceof
DBNLocalFolder
)
{
((
DBNLocalFolder
)
node
).
getFolder
().
setParent
(
null
);
}
else
{
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/actions/NavigatorHandlerObjectDelete.java
浏览文件 @
530fc3ef
...
...
@@ -55,14 +55,18 @@ public class NavigatorHandlerObjectDelete extends NavigatorHandlerObjectBase imp
return
null
;
}
final
IWorkbenchWindow
window
=
HandlerUtil
.
getActiveWorkbenchWindow
(
event
);
tryDeleteObjects
(
window
,
(
IStructuredSelection
)
selection
);
return
null
;
}
public
static
boolean
tryDeleteObjects
(
IWorkbenchWindow
window
,
IStructuredSelection
selection
)
{
@SuppressWarnings
(
"unchecked"
)
final
List
<
Object
>
selectedObjects
=
((
IStructuredSelection
)
selection
)
.
toList
();
final
List
<
Object
>
selectedObjects
=
selection
.
toList
();
final
NavigatorObjectsDeleter
deleter
=
NavigatorObjectsDeleter
.
of
(
selectedObjects
,
window
);
makeDeletionAttempt
(
window
,
selectedObjects
,
deleter
);
return
null
;
return
makeDeletionAttempt
(
window
,
selectedObjects
,
deleter
);
}
private
void
makeDeletionAttempt
(
final
IWorkbenchWindow
window
,
final
List
<
Object
>
selectedObjects
,
final
NavigatorObjectsDeleter
deleter
)
{
private
static
boolean
makeDeletionAttempt
(
final
IWorkbenchWindow
window
,
final
List
<
Object
>
selectedObjects
,
final
NavigatorObjectsDeleter
deleter
)
{
if
(
deleter
.
hasNodesFromDifferentDataSources
())
{
// attempt to delete database nodes from different databases
DBWorkbench
.
getPlatformUI
().
...
...
@@ -70,7 +74,7 @@ public class NavigatorHandlerObjectDelete extends NavigatorHandlerObjectBase imp
UINavigatorMessages
.
error_deleting_multiple_objects_from_different_datasources_title
,
UINavigatorMessages
.
error_deleting_multiple_objects_from_different_datasources_message
);
return
;
return
false
;
}
final
ConfirmationDialog
dialog
=
ConfirmationDialog
.
of
(
window
.
getShell
(),
...
...
@@ -79,13 +83,17 @@ public class NavigatorHandlerObjectDelete extends NavigatorHandlerObjectBase imp
final
int
result
=
dialog
.
open
();
if
(
result
==
IDialogConstants
.
YES_ID
)
{
deleter
.
delete
();
return
true
;
}
else
if
(
result
==
IDialogConstants
.
DETAILS_ID
)
{
final
boolean
persistCheck
=
deleter
.
showScriptWindow
();
if
(
persistCheck
)
{
deleter
.
delete
();
return
true
;
}
else
{
makeDeletionAttempt
(
window
,
selectedObjects
,
deleter
);
return
makeDeletionAttempt
(
window
,
selectedObjects
,
deleter
);
}
}
else
{
return
false
;
}
}
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/database/DatabaseNavigatorContent.java
浏览文件 @
530fc3ef
...
...
@@ -22,7 +22,7 @@ import org.jkiss.dbeaver.model.navigator.DBNNode;
/**
* Tree content
*/
class
DatabaseNavigatorContent
{
public
class
DatabaseNavigatorContent
{
private
final
DBNNode
rootNode
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录