Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
88550990
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,发现更多精彩内容 >>
提交
88550990
编写于
6月 22, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Toggle results panel command added
上级
98fefafd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
97 addition
and
2 deletion
+97
-2
plugins/org.jkiss.dbeaver.core/plugin.properties
plugins/org.jkiss.dbeaver.core/plugin.properties
+2
-0
plugins/org.jkiss.dbeaver.core/plugin.xml
plugins/org.jkiss.dbeaver.core/plugin.xml
+22
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
....core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
+14
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/handlers/ToggleResultsPanelHandler.java
...er/ui/editors/sql/handlers/ToggleResultsPanelHandler.java
+59
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/plugin.properties
浏览文件 @
88550990
...
...
@@ -105,6 +105,8 @@ command.org.jkiss.dbeaver.ui.editors.sql.run.validate.name=Validate Query
command.org.jkiss.dbeaver.ui.editors.sql.run.validate.description
=
Validate active query
command.org.jkiss.dbeaver.ui.editors.sql.run.analyse.name
=
Analyse Query
command.org.jkiss.dbeaver.ui.editors.sql.run.analyse.description
=
Analyse active query
command.org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel.name
=
Toggle results panel
command.org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel.description
=
Show/hide results panel
command.org.jkiss.dbeaver.ui.editors.sql.export.data.name
=
Export From Query
command.org.jkiss.dbeaver.ui.editors.sql.export.data.description
=
Export data returned by current query
command.org.jkiss.dbeaver.ui.editors.sql.navigate.object.name
=
Open Declaration
...
...
plugins/org.jkiss.dbeaver.core/plugin.xml
浏览文件 @
88550990
...
...
@@ -210,6 +210,7 @@
<command
id=
"org.jkiss.dbeaver.ui.editors.sql.run.validate"
name=
"%command.org.jkiss.dbeaver.ui.editors.sql.run.validate.name"
description=
"%command.org.jkiss.dbeaver.ui.editors.sql.run.validate.description"
categoryId=
"org.jkiss.dbeaver.core.sql"
/>
<command
id=
"org.jkiss.dbeaver.ui.editors.sql.run.analyse"
name=
"%command.org.jkiss.dbeaver.ui.editors.sql.run.analyse.name"
description=
"%command.org.jkiss.dbeaver.ui.editors.sql.run.analyse.description"
categoryId=
"org.jkiss.dbeaver.core.sql"
/>
<command
id=
"org.jkiss.dbeaver.ui.editors.sql.run.count"
name=
"%command.org.jkiss.dbeaver.ui.editors.sql.run.count.name"
description=
"%command.org.jkiss.dbeaver.ui.editors.sql.run.count.description"
categoryId=
"org.jkiss.dbeaver.core.sql"
/>
<command
id=
"org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel"
name=
"%command.org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel.name"
description=
"%command.org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel.description"
categoryId=
"org.jkiss.dbeaver.core.sql"
/>
<command
id=
"org.jkiss.dbeaver.ui.editors.sql.open.file"
name=
"%command.org.jkiss.dbeaver.ui.editors.sql.open.file.name"
description=
"%command.org.jkiss.dbeaver.ui.editors.sql.open.file.description"
categoryId=
"org.jkiss.dbeaver.core.sql"
/>
<command
id=
"org.jkiss.dbeaver.ui.editors.sql.save.file"
name=
"%command.org.jkiss.dbeaver.ui.editors.sql.save.file.name"
description=
"%command.org.jkiss.dbeaver.ui.editors.sql.save.file.description"
categoryId=
"org.jkiss.dbeaver.core.sql"
/>
<command
id=
"org.jkiss.dbeaver.ui.editors.sql.comment.single"
name=
"%command.org.jkiss.dbeaver.ui.editors.sql.comment.single.name"
description=
"%command.org.jkiss.dbeaver.ui.editors.sql.comment.single.description"
categoryId=
"org.jkiss.dbeaver.core.sql"
/>
...
...
@@ -810,6 +811,13 @@
</with>
</enabledWhen>
</handler>
<handler
commandId=
"org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel"
class=
"org.jkiss.dbeaver.ui.editors.sql.handlers.ToggleResultsPanelHandler"
>
<enabledWhen>
<with
variable=
"activePart"
>
<instanceof
value=
"org.jkiss.dbeaver.ui.editors.sql.SQLEditor"
/>
</with>
</enabledWhen>
</handler>
<handler
commandId=
"org.jkiss.dbeaver.ui.editors.sql.run.explain"
class=
"org.jkiss.dbeaver.ui.editors.sql.handlers.ExplainPlanHandler"
>
<enabledWhen>
<with
variable=
"activePart"
>
...
...
@@ -1579,6 +1587,14 @@
</with>
</visibleWhen>
</command>
<separator
name=
"misc"
visible=
"true"
/>
<command
commandId=
"org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel"
>
<visibleWhen>
<with
variable=
"activeEditor"
>
<instanceof
value=
"org.jkiss.dbeaver.ui.editors.sql.SQLEditor"
/>
</with>
</visibleWhen>
</command>
</menu>
</menuContribution>
...
...
@@ -1605,6 +1621,7 @@
<command
commandId=
"org.jkiss.dbeaver.ui.editors.sql.run.count"
/>
<command
commandId=
"org.jkiss.dbeaver.ui.editors.sql.export.data"
/>
<separator
name=
"other"
visible=
"true"
/>
<command
commandId=
"org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel"
/>
</menuContribution>
<!-- QM menu & toolbar -->
...
...
@@ -1689,6 +1706,11 @@
contextId=
"org.jkiss.dbeaver.ui.editors.sql"
schemeId=
"org.eclipse.ui.defaultAcceleratorConfiguration"
sequence=
"CTRL+SHIFT+E"
/>
<key
commandId=
"org.jkiss.dbeaver.ui.editors.sql.toggle.result.panel"
contextId=
"org.jkiss.dbeaver.ui.editors.sql"
schemeId=
"org.eclipse.ui.defaultAcceleratorConfiguration"
sequence=
"F6"
/>
<key
commandId=
"org.jkiss.dbeaver.ui.editors.sql.navigate.object"
contextId=
"org.jkiss.dbeaver.ui.editors.sql"
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
浏览文件 @
88550990
...
...
@@ -485,6 +485,15 @@ public class SQLEditor extends SQLEditorBase implements
}
}
public
void
toggleResultPanel
()
{
if
(
sashForm
.
getMaximizedControl
()
==
null
)
{
sashForm
.
setMaximizedControl
(
editorControl
);
}
else
{
sashForm
.
setMaximizedControl
(
null
);
}
}
@Override
public
IPathEditorInput
getEditorInput
()
{
...
...
@@ -621,6 +630,10 @@ public class SQLEditor extends SQLEditorBase implements
return
;
}
if
(
sashForm
.
getMaximizedControl
()
!=
null
)
{
sashForm
.
setMaximizedControl
(
null
);
}
final
boolean
isSingleQuery
=
(
queries
.
size
()
==
1
);
if
(!
newTab
||
!
isSingleQuery
)
{
...
...
@@ -908,8 +921,7 @@ public class SQLEditor extends SQLEditorBase implements
{
DBeaverUI
.
runUIJob
(
"Select SQL query in editor"
,
new
DBRRunnableWithProgress
()
{
@Override
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
if
(
select
)
{
selectAndReveal
(
query
.
getOffset
(),
query
.
getLength
());
setStatus
(
query
.
getQuery
(),
false
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/handlers/ToggleResultsPanelHandler.java
0 → 100644
浏览文件 @
88550990
/*
* 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.editors.sql.handlers
;
import
net.sf.jsqlparser.JSQLParserException
;
import
net.sf.jsqlparser.expression.Expression
;
import
net.sf.jsqlparser.expression.Function
;
import
net.sf.jsqlparser.expression.operators.relational.ExpressionList
;
import
net.sf.jsqlparser.parser.CCJSqlParserUtil
;
import
net.sf.jsqlparser.schema.Column
;
import
net.sf.jsqlparser.statement.Statement
;
import
net.sf.jsqlparser.statement.select.PlainSelect
;
import
net.sf.jsqlparser.statement.select.Select
;
import
net.sf.jsqlparser.statement.select.SelectExpressionItem
;
import
net.sf.jsqlparser.statement.select.SelectItem
;
import
org.eclipse.core.commands.AbstractHandler
;
import
org.eclipse.core.commands.ExecutionEvent
;
import
org.eclipse.core.commands.ExecutionException
;
import
org.eclipse.ui.handlers.HandlerUtil
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.Log
;
import
org.jkiss.dbeaver.model.sql.SQLQuery
;
import
org.jkiss.dbeaver.model.sql.SQLQueryTransformer
;
import
org.jkiss.dbeaver.runtime.RuntimeUtils
;
import
org.jkiss.dbeaver.ui.editors.sql.SQLEditor
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
public
class
ToggleResultsPanelHandler
extends
AbstractHandler
{
static
final
Log
log
=
Log
.
getLog
(
ToggleResultsPanelHandler
.
class
);
@Override
public
Object
execute
(
ExecutionEvent
event
)
throws
ExecutionException
{
SQLEditor
editor
=
RuntimeUtils
.
getObjectAdapter
(
HandlerUtil
.
getActiveEditor
(
event
),
SQLEditor
.
class
);
if
(
editor
!=
null
)
{
editor
.
toggleResultPanel
();
}
return
null
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录