Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
223e8e3d
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,发现更多精彩内容 >>
提交
223e8e3d
编写于
6月 22, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
QM refactoring (remove UI interactions from QM).
UI-Core split
上级
e0dde17c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
15 deletion
+41
-15
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverActivator.java
...ver.core/src/org/jkiss/dbeaver/core/DBeaverActivator.java
+8
-9
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverCore.java
....dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverCore.java
+0
-4
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
...ss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
+19
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
...rg/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
+14
-2
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverActivator.java
浏览文件 @
223e8e3d
...
@@ -54,10 +54,6 @@ public class DBeaverActivator extends AbstractUIPlugin
...
@@ -54,10 +54,6 @@ public class DBeaverActivator extends AbstractUIPlugin
return
instance
;
return
instance
;
}
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
@Override
public
void
start
(
BundleContext
context
)
public
void
start
(
BundleContext
context
)
throws
Exception
throws
Exception
...
@@ -65,6 +61,7 @@ public class DBeaverActivator extends AbstractUIPlugin
...
@@ -65,6 +61,7 @@ public class DBeaverActivator extends AbstractUIPlugin
super
.
start
(
context
);
super
.
start
(
context
);
instance
=
this
;
instance
=
this
;
DBeaverUI
.
getInstance
();
try
{
try
{
resourceBundle
=
ResourceBundle
.
getBundle
(
CoreMessages
.
BUNDLE_NAME
);
resourceBundle
=
ResourceBundle
.
getBundle
(
CoreMessages
.
BUNDLE_NAME
);
...
@@ -73,14 +70,11 @@ public class DBeaverActivator extends AbstractUIPlugin
...
@@ -73,14 +70,11 @@ public class DBeaverActivator extends AbstractUIPlugin
}
}
}
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
@Override
public
void
stop
(
BundleContext
context
)
public
void
stop
(
BundleContext
context
)
throws
Exception
throws
Exception
{
{
this
.
shutdownUI
();
this
.
shutdownCore
();
this
.
shutdownCore
();
if
(
debugWriter
!=
null
)
{
if
(
debugWriter
!=
null
)
{
...
@@ -92,6 +86,10 @@ public class DBeaverActivator extends AbstractUIPlugin
...
@@ -92,6 +86,10 @@ public class DBeaverActivator extends AbstractUIPlugin
super
.
stop
(
context
);
super
.
stop
(
context
);
}
}
private
void
shutdownUI
()
{
DBeaverUI
.
disposeUI
();
}
public
synchronized
PrintStream
getDebugWriter
()
public
synchronized
PrintStream
getDebugWriter
()
{
{
if
(
debugWriter
==
null
)
{
if
(
debugWriter
==
null
)
{
...
@@ -145,6 +143,7 @@ public class DBeaverActivator extends AbstractUIPlugin
...
@@ -145,6 +143,7 @@ public class DBeaverActivator extends AbstractUIPlugin
return
key
;
return
key
;
}
}
}
}
/**
/**
* Returns the workspace instance.
* Returns the workspace instance.
*/
*/
...
@@ -155,7 +154,7 @@ public class DBeaverActivator extends AbstractUIPlugin
...
@@ -155,7 +154,7 @@ public class DBeaverActivator extends AbstractUIPlugin
private
void
shutdownCore
()
private
void
shutdownCore
()
{
{
try
{
try
{
// Dispose core
// Dispose core
if
(
DBeaverCore
.
instance
!=
null
)
{
if
(
DBeaverCore
.
instance
!=
null
)
{
DBeaverCore
.
instance
.
dispose
();
DBeaverCore
.
instance
.
dispose
();
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverCore.java
浏览文件 @
223e8e3d
...
@@ -164,8 +164,6 @@ public class DBeaverCore implements DBPApplication {
...
@@ -164,8 +164,6 @@ public class DBeaverCore implements DBPApplication {
this
.
localSystem
=
new
OSDescriptor
(
Platform
.
getOS
(),
Platform
.
getOSArch
());
this
.
localSystem
=
new
OSDescriptor
(
Platform
.
getOS
(),
Platform
.
getOSArch
());
DBeaverUI
.
getInstance
();
IExtensionRegistry
extensionRegistry
=
Platform
.
getExtensionRegistry
();
IExtensionRegistry
extensionRegistry
=
Platform
.
getExtensionRegistry
();
this
.
queryManager
=
new
QMControllerImpl
();
this
.
queryManager
=
new
QMControllerImpl
();
...
@@ -280,8 +278,6 @@ public class DBeaverCore implements DBPApplication {
...
@@ -280,8 +278,6 @@ public class DBeaverCore implements DBPApplication {
}
}
}
}
DBeaverUI
.
disposeUI
();
DBeaverCore
.
instance
=
null
;
DBeaverCore
.
instance
=
null
;
DBeaverCore
.
disposed
=
true
;
DBeaverCore
.
disposed
=
true
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/DBeaverUI.java
浏览文件 @
223e8e3d
...
@@ -29,6 +29,7 @@ import org.eclipse.swt.widgets.Shell;
...
@@ -29,6 +29,7 @@ import org.eclipse.swt.widgets.Shell;
import
org.eclipse.ui.IWorkbench
;
import
org.eclipse.ui.IWorkbench
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.eclipse.ui.PlatformUI
;
import
org.eclipse.ui.PlatformUI
;
import
org.eclipse.ui.services.IDisposable
;
import
org.jkiss.dbeaver.DBeaverPreferences
;
import
org.jkiss.dbeaver.DBeaverPreferences
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableContext
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableContext
;
...
@@ -42,6 +43,9 @@ import org.jkiss.dbeaver.ui.TrayIconHandler;
...
@@ -42,6 +43,9 @@ import org.jkiss.dbeaver.ui.TrayIconHandler;
import
org.osgi.framework.Bundle
;
import
org.osgi.framework.Bundle
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
/**
/**
* DBeaver UI core
* DBeaver UI core
...
@@ -54,6 +58,7 @@ public class DBeaverUI {
...
@@ -54,6 +58,7 @@ public class DBeaverUI {
private
SharedTextColors
sharedTextColors
;
private
SharedTextColors
sharedTextColors
;
private
TrayIconHandler
trayItem
;
private
TrayIconHandler
trayItem
;
private
final
List
<
IDisposable
>
globalDisposables
=
new
ArrayList
<
IDisposable
>();
public
static
DBeaverUI
getInstance
()
public
static
DBeaverUI
getInstance
()
{
{
...
@@ -84,6 +89,17 @@ public class DBeaverUI {
...
@@ -84,6 +89,17 @@ public class DBeaverUI {
if
(
trayItem
!=
null
)
{
if
(
trayItem
!=
null
)
{
trayItem
.
hide
();
trayItem
.
hide
();
}
}
List
<
IDisposable
>
dispList
=
new
ArrayList
<
IDisposable
>(
globalDisposables
);
Collections
.
reverse
(
dispList
);
for
(
IDisposable
disp
:
dispList
)
{
try
{
disp
.
dispose
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
);
}
globalDisposables
.
remove
(
disp
);
}
}
}
private
void
initialize
()
private
void
initialize
()
...
@@ -257,4 +273,7 @@ public class DBeaverUI {
...
@@ -257,4 +273,7 @@ public class DBeaverUI {
getInstance
().
trayItem
.
notify
(
message
,
status
);
getInstance
().
trayItem
.
notify
(
message
,
status
);
}
}
public
void
addDisposeListener
(
IDisposable
disposable
)
{
globalDisposables
.
add
(
disposable
);
}
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
浏览文件 @
223e8e3d
...
@@ -21,15 +21,20 @@ import org.eclipse.core.expressions.PropertyTester;
...
@@ -21,15 +21,20 @@ import org.eclipse.core.expressions.PropertyTester;
import
org.eclipse.swt.widgets.Display
;
import
org.eclipse.swt.widgets.Display
;
import
org.eclipse.ui.PlatformUI
;
import
org.eclipse.ui.PlatformUI
;
import
org.eclipse.ui.commands.ICommandService
;
import
org.eclipse.ui.commands.ICommandService
;
import
org.eclipse.ui.services.IDisposable
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.model.DBPContextProvider
;
import
org.jkiss.dbeaver.model.DBPContextProvider
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.qm.QMUtils
;
import
org.jkiss.dbeaver.model.qm.QMUtils
;
import
org.jkiss.dbeaver.runtime.qm.DefaultExecutionHandler
;
import
org.jkiss.dbeaver.runtime.qm.DefaultExecutionHandler
;
import
org.jkiss.dbeaver.runtime.qm.meta.*
;
import
org.jkiss.dbeaver.runtime.qm.meta.QMMSessionInfo
;
import
org.jkiss.dbeaver.runtime.qm.meta.QMMStatementExecuteInfo
;
import
org.jkiss.dbeaver.runtime.qm.meta.QMMTransactionInfo
;
import
org.jkiss.dbeaver.runtime.qm.meta.QMMTransactionSavepointInfo
;
import
org.jkiss.dbeaver.ui.ActionUtils
;
import
org.jkiss.dbeaver.ui.ActionUtils
;
import
org.jkiss.dbeaver.ui.ICommandIds
;
import
org.jkiss.dbeaver.ui.ICommandIds
;
...
@@ -47,7 +52,14 @@ public class DataSourcePropertyTester extends PropertyTester
...
@@ -47,7 +52,14 @@ public class DataSourcePropertyTester extends PropertyTester
public
DataSourcePropertyTester
()
{
public
DataSourcePropertyTester
()
{
super
();
super
();
QMUtils
.
registerHandler
(
new
QMEventsHandler
());
final
QMEventsHandler
qmHandler
=
new
QMEventsHandler
();
QMUtils
.
registerHandler
(
qmHandler
);
DBeaverUI
.
getInstance
().
addDisposeListener
(
new
IDisposable
()
{
@Override
public
void
dispose
()
{
QMUtils
.
unregisterHandler
(
qmHandler
);
}
});
}
}
@Override
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录