Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
e2ebd65c
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,发现更多精彩内容 >>
提交
e2ebd65c
编写于
5月 20, 2016
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Instance server
Former-commit-id:
17e4606c
上级
a2b20a96
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
9 deletion
+22
-9
features/org.jkiss.dbeaver.standalone.feature/feature.xml
features/org.jkiss.dbeaver.standalone.feature/feature.xml
+1
-0
plugins/org.jkiss.dbeaver.core.application/src/org/jkiss/dbeaver/core/application/DBeaverApplication.java
...rg/jkiss/dbeaver/core/application/DBeaverApplication.java
+12
-8
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverInstanceServer.java
...ore/src/org/jkiss/dbeaver/core/DBeaverInstanceServer.java
+9
-1
未找到文件。
features/org.jkiss.dbeaver.standalone.feature/feature.xml
浏览文件 @
e2ebd65c
...
...
@@ -65,6 +65,7 @@
<import
plugin=
"org.apache.commons.logging"
/>
<import
plugin=
"com.jcraft.jsch"
/>
<import
plugin=
"org.objectweb.asm"
/>
<import
plugin=
"org.apache.commons.cli"
/>
</requires>
<!-- Include org.eclipse.ui.themes because it was added only in 4.4 -->
...
...
plugins/org.jkiss.dbeaver.core.application/src/org/jkiss/dbeaver/core/application/DBeaverApplication.java
浏览文件 @
e2ebd65c
...
...
@@ -57,29 +57,33 @@ public class DBeaverApplication implements IApplication
@Override
public
Object
start
(
IApplicationContext
context
)
{
Display
display
=
PlatformUI
.
createDisplay
()
;
Display
display
=
null
;
Location
instanceLoc
=
Platform
.
getInstanceLocation
();
String
defaultHomePath
=
getDefaultWorkspaceLocation
().
getAbsolutePath
();
try
{
URL
defaultHomeURL
=
new
File
(
defaultHomePath
).
toURI
().
toURL
();
boolean
keepTrying
=
true
;
Shell
shell
=
null
;
while
(
keepTrying
)
{
if
(!
instanceLoc
.
set
(
defaultHomeURL
,
true
))
{
if
(
handleCommandLine
(
defaultHomePath
))
{
return
IApplication
.
EXIT_OK
;
}
// Can't lock specified path
if
(
shell
==
null
)
{
shell
=
new
Shell
(
display
,
SWT
.
ON_TOP
);
if
(
display
==
null
)
{
display
=
PlatformUI
.
createDisplay
(
);
}
Shell
shell
=
new
Shell
(
display
,
SWT
.
ON_TOP
);
MessageBox
messageBox
=
new
MessageBox
(
shell
,
SWT
.
ICON_WARNING
|
SWT
.
IGNORE
|
SWT
.
RETRY
|
SWT
.
ABORT
);
messageBox
.
setText
(
"DBeaver - Can't lock workspace"
);
messageBox
.
setMessage
(
"Can't lock workspace at "
+
defaultHomePath
+
".\n"
+
"It seems that you have another DBeaver instance running.\n"
+
"You may ignore it and work without lock but it is recommended to shutdown previous instance otherwise you may corrupt workspace data."
);
switch
(
messageBox
.
open
())
{
int
msgResult
=
messageBox
.
open
();
shell
.
dispose
();
switch
(
msgResult
)
{
case
SWT
.
ABORT
:
return
IApplication
.
EXIT_OK
;
case
SWT
.
IGNORE
:
...
...
@@ -93,9 +97,6 @@ public class DBeaverApplication implements IApplication
break
;
}
}
if
(
shell
!=
null
)
{
shell
.
dispose
();
}
}
catch
(
Throwable
e
)
{
// Just skip it
...
...
@@ -103,6 +104,9 @@ public class DBeaverApplication implements IApplication
System
.
err
.
println
(
"Can't switch workspace to '"
+
defaultHomePath
+
"' - "
+
e
.
getMessage
());
//$NON-NLS-1$ //$NON-NLS-2$
}
if
(
display
==
null
)
{
display
=
PlatformUI
.
createDisplay
();
}
final
Runtime
runtime
=
Runtime
.
getRuntime
();
DBeaverCore
.
setStandalone
(
true
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverInstanceServer.java
浏览文件 @
e2ebd65c
...
...
@@ -21,6 +21,7 @@ package org.jkiss.dbeaver.core;
import
org.eclipse.core.filesystem.EFS
;
import
org.eclipse.core.filesystem.IFileStore
;
import
org.eclipse.core.runtime.CoreException
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.ui.IEditorDescriptor
;
import
org.eclipse.ui.IEditorInput
;
import
org.eclipse.ui.IWorkbenchWindow
;
...
...
@@ -58,7 +59,8 @@ public class DBeaverInstanceServer implements IInstanceController {
@Override
public
void
openExternalFiles
(
final
String
[]
fileNames
)
{
final
IWorkbenchWindow
window
=
DBeaverUI
.
getActiveWorkbenchWindow
();
UIUtils
.
runInUI
(
window
.
getShell
(),
new
Runnable
()
{
final
Shell
shell
=
window
.
getShell
();
UIUtils
.
runInUI
(
shell
,
new
Runnable
()
{
@Override
public
void
run
()
{
for
(
String
filePath
:
fileNames
)
{
...
...
@@ -74,6 +76,12 @@ public class DBeaverInstanceServer implements IInstanceController {
}
}
}
if
(!
shell
.
getMinimized
())
{
shell
.
setMinimized
(
true
);
}
shell
.
setMinimized
(
false
);
shell
.
setActive
();
}
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录