Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
6bcafe1a
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,发现更多精彩内容 >>
提交
6bcafe1a
编写于
8月 09, 2018
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SQL editor command context fix
上级
8b1d093f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
25 deletion
+4
-25
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/WorkbenchContextListener.java
.../src/org/jkiss/dbeaver/core/WorkbenchContextListener.java
+2
-17
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorBase.java
...e/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorBase.java
+1
-8
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorContributions.java
.../jkiss/dbeaver/ui/editors/sql/SQLEditorContributions.java
+1
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/WorkbenchContextListener.java
浏览文件 @
6bcafe1a
...
...
@@ -31,8 +31,6 @@ import org.jkiss.dbeaver.ui.ActionUtils;
import
org.jkiss.dbeaver.ui.DBeaverUIConstants
;
import
org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer
;
import
org.jkiss.dbeaver.ui.editors.entity.EntityEditor
;
import
org.jkiss.dbeaver.ui.editors.sql.SQLEditorBase
;
import
org.jkiss.dbeaver.ui.navigator.INavigatorModelView
;
/**
* WorkbenchContextListener.
...
...
@@ -44,11 +42,9 @@ class WorkbenchContextListener implements IWindowListener, IPageListener, IPartL
//private static final Log log = Log.getLog(WorkbenchContextListener.class);
public
static
final
String
SQL_EDITOR_CONTEXT_ID
=
"org.jkiss.dbeaver.ui.editors.sql"
;
public
static
final
String
RESULTS_CONTEXT_ID
=
"org.jkiss.dbeaver.ui.context.resultset"
;
public
static
final
String
PERSPECTIVE_CONTEXT_ID
=
"org.jkiss.dbeaver.ui.perspective"
;
private
static
final
String
RESULTS_CONTEXT_ID
=
"org.jkiss.dbeaver.ui.context.resultset"
;
private
static
final
String
PERSPECTIVE_CONTEXT_ID
=
"org.jkiss.dbeaver.ui.perspective"
;
private
IContextActivation
activationSQL
;
private
IContextActivation
activationResults
;
private
CommandExecutionListener
commandExecutionListener
;
...
...
@@ -171,13 +167,6 @@ class WorkbenchContextListener implements IWindowListener, IPageListener, IPartL
}
try
{
contextService
.
deferUpdates
(
true
);
if
(
part
.
getAdapter
(
SQLEditorBase
.
class
)
!=
null
)
{
if
(
activationSQL
!=
null
)
{
//log.debug("Double activation of SQL context");
contextService
.
deactivateContext
(
activationSQL
);
}
activationSQL
=
contextService
.
activateContext
(
SQL_EDITOR_CONTEXT_ID
);
}
if
(
part
.
getAdapter
(
ResultSetViewer
.
class
)
!=
null
||
(
part
instanceof
EntityEditor
&&
((
EntityEditor
)
part
).
getDatabaseObject
()
instanceof
DBSDataContainer
))
{
...
...
@@ -207,10 +196,6 @@ class WorkbenchContextListener implements IWindowListener, IPageListener, IPartL
}
try
{
contextService
.
deferUpdates
(
true
);
if
(
activationSQL
!=
null
&&
part
instanceof
SQLEditorBase
)
{
contextService
.
deactivateContext
(
activationSQL
);
activationSQL
=
null
;
}
if
(
activationResults
!=
null
)
{
contextService
.
deactivateContext
(
activationResults
);
activationResults
=
null
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorBase.java
浏览文件 @
6bcafe1a
...
...
@@ -29,16 +29,11 @@ import org.eclipse.jface.text.source.projection.ProjectionViewer;
import
org.eclipse.jface.util.IPropertyChangeListener
;
import
org.eclipse.jface.util.PropertyChangeEvent
;
import
org.eclipse.jface.viewers.ISelectionProvider
;
import
org.eclipse.swt.custom.StyledText
;
import
org.eclipse.swt.events.FocusEvent
;
import
org.eclipse.swt.events.FocusListener
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Shell
;
import
org.eclipse.ui.IEditorInput
;
import
org.eclipse.ui.IWorkbenchActionConstants
;
import
org.eclipse.ui.PlatformUI
;
import
org.eclipse.ui.contexts.IContextActivation
;
import
org.eclipse.ui.contexts.IContextService
;
import
org.eclipse.ui.dialogs.PreferencesUtil
;
import
org.eclipse.ui.editors.text.EditorsUI
;
import
org.eclipse.ui.texteditor.*
;
...
...
@@ -86,8 +81,6 @@ public abstract class SQLEditorBase extends BaseTextEditor implements IErrorVisu
static
protected
final
Log
log
=
Log
.
getLog
(
SQLEditorBase
.
class
);
public
static
final
String
SQL_CONTROL_CONTEXT_ID
=
"org.jkiss.dbeaver.ui.editors.sql.script.focused"
;
static
{
// SQL editor preferences. Do this here because it initializes display
// (that's why we can't run it in prefs initializer classes which run before workbench creation)
...
...
@@ -251,7 +244,7 @@ public abstract class SQLEditorBase extends BaseTextEditor implements IErrorVisu
{
// Context listener
EditorUtils
.
trackControlContext
(
getSite
(),
getViewer
().
getTextWidget
(),
SQL
_CONTROL_CONTEXT_ID
);
EditorUtils
.
trackControlContext
(
getSite
(),
getViewer
().
getTextWidget
(),
SQL
EditorContributions
.
SQL_EDITOR_CONTROL_CONTEXT
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorContributions.java
浏览文件 @
6bcafe1a
...
...
@@ -20,6 +20,7 @@ public class SQLEditorContributions {
public
static
final
String
SQL_EDITOR_CONTEXT
=
"org.jkiss.dbeaver.ui.editors.sql"
;
//$NON-NLS-1$
public
static
final
String
SQL_EDITOR_SCRIPT_CONTEXT
=
"org.jkiss.dbeaver.ui.editors.sql.script"
;
//$NON-NLS-1$
public
static
final
String
SQL_EDITOR_CONTROL_CONTEXT
=
"org.jkiss.dbeaver.ui.editors.sql.script.focused"
;
public
static
final
String
SQL_EDITOR_CONTEXT_MENU_ID
=
"#SQLEditorContext"
;
//$NON-NLS-1$
public
static
final
String
SQL_RULER_CONTEXT_MENU_ID
=
"#SQLRulerContext"
;
//$NON-NLS-1$
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录