Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
0ef10b1b
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,发现更多精彩内容 >>
提交
0ef10b1b
编写于
6月 24, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Model code cleanup
上级
33a430b2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
135 deletion
+32
-135
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/load/jobs/LoadingJob.java
...e/src/org/jkiss/dbeaver/runtime/load/jobs/LoadingJob.java
+0
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/load/jobs/LoadingUIJob.java
...src/org/jkiss/dbeaver/runtime/load/jobs/LoadingUIJob.java
+0
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/load/jobs/NonConflictingRule.java
...g/jkiss/dbeaver/runtime/load/jobs/NonConflictingRule.java
+0
-35
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceConnectHandler.java
...eaver/ui/actions/datasource/DataSourceConnectHandler.java
+32
-25
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionAuthDialog.java
...s/dbeaver/ui/dialogs/connection/ConnectionAuthDialog.java
+0
-73
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/load/jobs/LoadingJob.java
浏览文件 @
0ef10b1b
...
...
@@ -45,7 +45,6 @@ public class LoadingJob<RESULT> extends AbstractJob {
this
.
loadingService
=
loadingService
;
this
.
visualizer
=
visualizer
;
setUser
(
false
);
setRule
(
new
NonConflictingRule
());
}
public
ILoadService
<
RESULT
>
getLoadingService
()
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/load/jobs/LoadingUIJob.java
浏览文件 @
0ef10b1b
...
...
@@ -41,7 +41,6 @@ class LoadingUIJob<RESULT> extends AbstractUIJob {
this
.
visualizer
=
loadingJob
.
getVisualizer
();
this
.
mainMonitor
=
mainMonitor
;
setSystem
(
true
);
setRule
(
new
NonConflictingRule
());
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/load/jobs/NonConflictingRule.java
已删除
100644 → 0
浏览文件 @
33a430b2
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package
org.jkiss.dbeaver.runtime.load.jobs
;
import
org.eclipse.core.runtime.jobs.ISchedulingRule
;
public
class
NonConflictingRule
implements
ISchedulingRule
{
@Override
public
boolean
contains
(
ISchedulingRule
rule
)
{
return
rule
==
this
;
}
@Override
public
boolean
isConflicting
(
ISchedulingRule
rule
)
{
return
rule
==
this
;
}
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceConnectHandler.java
浏览文件 @
0ef10b1b
...
...
@@ -23,20 +23,21 @@ import org.eclipse.core.runtime.IStatus;
import
org.eclipse.core.runtime.jobs.IJobChangeEvent
;
import
org.eclipse.core.runtime.jobs.Job
;
import
org.eclipse.core.runtime.jobs.JobChangeAdapter
;
import
org.eclipse.
jface.dialogs.IDialogConstants
;
import
org.eclipse.
osgi.util.NLS
;
import
org.eclipse.swt.widgets.Display
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.DBPEvent
;
import
org.jkiss.dbeaver.model.access.DBAAuthInfo
;
import
org.jkiss.dbeaver.model.net.DBWHandlerConfiguration
;
import
org.jkiss.dbeaver.model.runtime.DBRProcessListener
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.DBSDataSourceContainer
;
import
org.jkiss.dbeaver.model.ui.DBUserInterface
;
import
org.jkiss.dbeaver.registry.DataSourceDescriptor
;
import
org.jkiss.dbeaver.runtime.jobs.ConnectJob
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.actions.DataSourceHandler
;
import
org.jkiss.dbeaver.ui.dialogs.connection.ConnectionAuthDialog
;
import
org.jkiss.utils.ArrayUtils
;
public
class
DataSourceConnectHandler
extends
DataSourceHandler
...
...
@@ -96,8 +97,7 @@ public class DataSourceConnectHandler extends DataSourceHandler
if
(
onFinish
!=
null
)
{
onFinish
.
onProcessFinish
(
result
);
}
else
if
(!
result
.
isOK
())
{
UIUtils
.
showErrorDialog
(
null
,
DBUserInterface
.
getInstance
().
showError
(
connectJob
.
getName
(),
null
,
//NLS.bind(CoreMessages.runtime_jobs_connect_status_error, dataSourceContainer.getName()),
result
);
...
...
@@ -156,27 +156,34 @@ public class DataSourceConnectHandler extends DataSourceHandler
false
);
}
public
static
boolean
askForPassword
(
@NotNull
final
DataSourceDescriptor
dataSourceContainer
,
@Nullable
final
DBWHandlerConfiguration
h
andler
)
public
static
boolean
askForPassword
(
@NotNull
final
DataSourceDescriptor
dataSourceContainer
,
@Nullable
final
DBWHandlerConfiguration
networkH
andler
)
{
final
boolean
[]
authResult
=
new
boolean
[]
{
false
};
UIUtils
.
runInUI
(
null
,
new
Runnable
()
{
@Override
public
void
run
()
{
ConnectionAuthDialog
auth
=
new
ConnectionAuthDialog
(
UIUtils
.
getActiveShell
(),
dataSourceContainer
,
handler
);
int
result
=
auth
.
open
();
if
(
result
==
IDialogConstants
.
OK_ID
)
{
if
(
dataSourceContainer
.
isSavePassword
())
{
// Update connection properties
dataSourceContainer
.
getRegistry
().
updateDataSource
(
dataSourceContainer
);
}
authResult
[
0
]
=
true
;
}
else
{
authResult
[
0
]
=
false
;
}
}
});
return
authResult
[
0
];
String
prompt
=
networkHandler
!=
null
?
NLS
.
bind
(
CoreMessages
.
dialog_connection_auth_title_for_handler
,
networkHandler
.
getTitle
())
:
"'"
+
dataSourceContainer
.
getName
()
+
CoreMessages
.
dialog_connection_auth_title
;
//$NON-NLS-1$
String
user
=
networkHandler
!=
null
?
networkHandler
.
getUserName
()
:
dataSourceContainer
.
getConnectionInfo
().
getUserName
();
String
password
=
networkHandler
!=
null
?
networkHandler
.
getPassword
()
:
dataSourceContainer
.
getConnectionInfo
().
getUserPassword
();
DBAAuthInfo
authInfo
=
DBUserInterface
.
getInstance
().
promptUserCredentials
(
prompt
,
user
,
password
);
if
(
authInfo
==
null
)
{
return
false
;
}
if
(
networkHandler
!=
null
)
{
networkHandler
.
setUserName
(
authInfo
.
getUserName
());
networkHandler
.
setPassword
(
authInfo
.
getUserPassword
());
networkHandler
.
setSavePassword
(
authInfo
.
isSavePassword
());
}
else
{
dataSourceContainer
.
getConnectionInfo
().
setUserName
(
authInfo
.
getUserName
());
dataSourceContainer
.
getConnectionInfo
().
setUserPassword
(
authInfo
.
getUserPassword
());
dataSourceContainer
.
setSavePassword
(
authInfo
.
isSavePassword
());
}
if
(
dataSourceContainer
.
isSavePassword
())
{
// Update connection properties
dataSourceContainer
.
getRegistry
().
updateDataSource
(
dataSourceContainer
);
}
return
true
;
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionAuthDialog.java
已删除
100644 → 0
浏览文件 @
33a430b2
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package
org.jkiss.dbeaver.ui.dialogs.connection
;
import
org.eclipse.osgi.util.NLS
;
import
org.eclipse.swt.widgets.Shell
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.net.DBWHandlerConfiguration
;
import
org.jkiss.dbeaver.registry.DataSourceDescriptor
;
import
org.jkiss.dbeaver.ui.DBeaverIcons
;
import
org.jkiss.utils.CommonUtils
;
/**
* Connection auth dialog
*/
public
class
ConnectionAuthDialog
extends
BaseAuthDialog
{
private
DataSourceDescriptor
dataSource
;
private
DBWHandlerConfiguration
networkHandler
;
public
ConnectionAuthDialog
(
@NotNull
Shell
parentShell
,
@NotNull
DataSourceDescriptor
dataSource
,
@Nullable
DBWHandlerConfiguration
networkHandler
)
{
super
(
parentShell
,
networkHandler
!=
null
?
NLS
.
bind
(
CoreMessages
.
dialog_connection_auth_title_for_handler
,
networkHandler
.
getTitle
())
:
"'"
+
dataSource
.
getName
()
+
CoreMessages
.
dialog_connection_auth_title
//$NON-NLS-1$
);
this
.
dataSource
=
dataSource
;
this
.
networkHandler
=
networkHandler
;
if
(
networkHandler
!=
null
)
{
setUserName
(
CommonUtils
.
notEmpty
(
networkHandler
.
getUserName
()));
setUserPassword
(
CommonUtils
.
notEmpty
(
networkHandler
.
getPassword
()));
}
else
{
setUserName
(
CommonUtils
.
notEmpty
(
dataSource
.
getConnectionInfo
().
getUserName
()));
setUserPassword
(
CommonUtils
.
notEmpty
(
dataSource
.
getConnectionInfo
().
getUserPassword
()));
}
}
@Override
protected
void
okPressed
()
{
super
.
okPressed
();
if
(
networkHandler
!=
null
)
{
networkHandler
.
setUserName
(
getUserName
());
networkHandler
.
setPassword
(
getUserPassword
());
networkHandler
.
setSavePassword
(
isSavePassword
());
}
else
{
dataSource
.
getConnectionInfo
().
setUserName
(
getUserName
());
dataSource
.
getConnectionInfo
().
setUserPassword
(
getUserPassword
());
dataSource
.
setSavePassword
(
isSavePassword
());
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录