Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
4a47ba6f
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,发现更多精彩内容 >>
提交
4a47ba6f
编写于
6月 23, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove jface from model.
上级
423c467c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
61 addition
and
20 deletion
+61
-20
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/edit/AbstractCommandContext.java
...jkiss/dbeaver/model/impl/edit/AbstractCommandContext.java
+4
-12
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/SimpleCommandContext.java
...r.core/src/org/jkiss/dbeaver/ui/SimpleCommandContext.java
+45
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/navigator/NavigatorHandlerObjectBase.java
...aver/ui/actions/navigator/NavigatorHandlerObjectBase.java
+6
-5
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
...src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
+6
-3
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/edit/
DBECommandContextImpl
.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/edit/
AbstractCommandContext
.java
浏览文件 @
4a47ba6f
...
...
@@ -17,11 +17,8 @@
*/
package
org.jkiss.dbeaver.model.impl.edit
;
import
org.eclipse.ui.IWorkbenchCommandConstants
;
import
org.eclipse.ui.commands.ICommandService
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.model.DBPObject
;
import
org.jkiss.dbeaver.model.edit.*
;
...
...
@@ -38,9 +35,9 @@ import java.util.*;
/**
* DBECommandContextImpl
*/
public
class
DBECommandContextImpl
implements
DBECommandContext
{
public
abstract
class
AbstractCommandContext
implements
DBECommandContext
{
static
final
Log
log
=
Log
.
getLog
(
DBECommandContextImpl
.
class
);
static
final
Log
log
=
Log
.
getLog
(
AbstractCommandContext
.
class
);
private
final
DBCExecutionContext
executionContext
;
private
final
List
<
CommandInfo
>
commands
=
new
ArrayList
<
CommandInfo
>();
...
...
@@ -58,7 +55,7 @@ public class DBECommandContextImpl implements DBECommandContext {
* @param atomic atomic context reflect commands in UI only after all comands were executed. Non-atomic
* reflects each command at the moment it executed
*/
public
DBECommandContextImpl
(
DBCExecutionContext
executionContext
,
boolean
atomic
)
public
AbstractCommandContext
(
DBCExecutionContext
executionContext
,
boolean
atomic
)
{
this
.
executionContext
=
executionContext
;
this
.
atomic
=
atomic
;
...
...
@@ -653,13 +650,8 @@ public class DBECommandContextImpl implements DBECommandContext {
session
.
close
();
}
pr
ivate
void
refreshCommandState
()
pr
otected
void
refreshCommandState
()
{
ICommandService
commandService
=
(
ICommandService
)
DBeaverUI
.
getActiveWorkbenchWindow
().
getService
(
ICommandService
.
class
);
if
(
commandService
!=
null
)
{
commandService
.
refreshElements
(
IWorkbenchCommandConstants
.
EDIT_UNDO
,
null
);
commandService
.
refreshElements
(
IWorkbenchCommandConstants
.
EDIT_REDO
,
null
);
}
}
private
static
class
PersistInfo
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/SimpleCommandContext.java
0 → 100644
浏览文件 @
4a47ba6f
/*
* 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
;
import
org.eclipse.ui.IWorkbenchCommandConstants
;
import
org.eclipse.ui.commands.ICommandService
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.edit.AbstractCommandContext
;
/**
* SimpleCommandContext.
* Uses jface command service to update commands state
*/
public
class
SimpleCommandContext
extends
AbstractCommandContext
{
public
SimpleCommandContext
(
DBCExecutionContext
executionContext
,
boolean
atomic
)
{
super
(
executionContext
,
atomic
);
}
protected
void
refreshCommandState
()
{
ICommandService
commandService
=
(
ICommandService
)
DBeaverUI
.
getActiveWorkbenchWindow
().
getService
(
ICommandService
.
class
);
if
(
commandService
!=
null
)
{
commandService
.
refreshElements
(
IWorkbenchCommandConstants
.
EDIT_UNDO
,
null
);
commandService
.
refreshElements
(
IWorkbenchCommandConstants
.
EDIT_REDO
,
null
);
}
}
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/navigator/NavigatorHandlerObjectBase.java
浏览文件 @
4a47ba6f
...
...
@@ -26,14 +26,12 @@ import org.jkiss.dbeaver.DBException;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.ui.editors.IDatabaseEditor
;
import
org.jkiss.dbeaver.ui.editors.IDatabaseEditorInput
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.edit.DBECommand
;
import
org.jkiss.dbeaver.model.edit.DBECommandContext
;
import
org.jkiss.dbeaver.model.edit.DBEStructEditor
;
import
org.jkiss.dbeaver.model.impl.edit.
DBECommandContextImpl
;
import
org.jkiss.dbeaver.model.impl.edit.
AbstractCommandContext
;
import
org.jkiss.dbeaver.model.navigator.DBNContainer
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseFolder
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode
;
...
...
@@ -45,9 +43,12 @@ import org.jkiss.dbeaver.model.struct.DBSObjectReference;
import
org.jkiss.dbeaver.registry.editor.EntityEditorsRegistry
;
import
org.jkiss.dbeaver.runtime.RuntimeUtils
;
import
org.jkiss.dbeaver.ui.DBIcon
;
import
org.jkiss.dbeaver.ui.SimpleCommandContext
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.controls.folders.IFolderContainer
;
import
org.jkiss.dbeaver.ui.dialogs.sql.ViewSQLDialog
;
import
org.jkiss.dbeaver.ui.editors.IDatabaseEditor
;
import
org.jkiss.dbeaver.ui.editors.IDatabaseEditorInput
;
import
org.jkiss.dbeaver.ui.views.navigator.database.DatabaseNavigatorView
;
import
java.lang.reflect.InvocationTargetException
;
...
...
@@ -68,7 +69,7 @@ public abstract class NavigatorHandlerObjectBase extends AbstractHandler {
private
CommandTarget
()
{
}
private
CommandTarget
(
DBECommandContextImpl
context
)
private
CommandTarget
(
AbstractCommandContext
context
)
{
this
.
context
=
context
;
}
...
...
@@ -132,7 +133,7 @@ public abstract class NavigatorHandlerObjectBase extends AbstractHandler {
// No editor found - create new command context
DBPDataSource
dataSource
=
((
DBNDatabaseNode
)
container
).
getObject
().
getDataSource
();
if
(
dataSource
!=
null
)
{
return
new
CommandTarget
(
new
DBECommandContextImpl
(
dataSource
.
getDefaultContext
(
true
),
!
openEditor
));
return
new
CommandTarget
(
new
SimpleCommandContext
(
dataSource
.
getDefaultContext
(
true
),
!
openEditor
));
}
}
return
new
CommandTarget
();
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
浏览文件 @
4a47ba6f
...
...
@@ -30,14 +30,17 @@ import org.jkiss.dbeaver.model.DBPPropertySource;
import
org.jkiss.dbeaver.model.IDataSourceContainerProvider
;
import
org.jkiss.dbeaver.model.edit.DBECommandContext
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.edit.DBECommandContextImpl
;
import
org.jkiss.dbeaver.model.navigator.DBNDataSource
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode
;
import
org.jkiss.dbeaver.model.struct.DBSDataSourceContainer
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.ui.SimpleCommandContext
;
import
org.jkiss.dbeaver.ui.properties.PropertySourceEditable
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
/**
* DatabaseEditorInput
...
...
@@ -65,7 +68,7 @@ public abstract class DatabaseEditorInput<NODE extends DBNDatabaseNode> implemen
this
.
executionContext
=
dataSource
.
getDefaultContext
(
false
);
this
.
commandContext
=
commandContext
!=
null
?
commandContext
:
new
DBECommandContextImpl
(
new
SimpleCommandContext
(
this
.
executionContext
,
false
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录