Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
e93c02ef
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,发现更多精彩内容 >>
提交
e93c02ef
编写于
6月 21, 2018
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SQL presentatiomn commands state enablement
Former-commit-id:
dd16e850
上级
38282ac6
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
89 addition
and
87 deletion
+89
-87
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/WorkbenchContextListener.java
.../src/org/jkiss/dbeaver/core/WorkbenchContextListener.java
+2
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/sql/SQLPresentationDescriptor.java
...jkiss/dbeaver/registry/sql/SQLPresentationDescriptor.java
+4
-11
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
...rg/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
+1
-17
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
....core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
+61
-43
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorBase.java
...e/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorBase.java
+7
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorContributor.java
...rg/jkiss/dbeaver/ui/editors/sql/SQLEditorContributor.java
+1
-13
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorPresentation.java
...g/jkiss/dbeaver/ui/editors/sql/SQLEditorPresentation.java
+5
-0
plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/ActionUtils.java
...kiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/ActionUtils.java
+8
-0
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/WorkbenchContextListener.java
浏览文件 @
e93c02ef
...
...
@@ -27,8 +27,8 @@ import org.eclipse.ui.contexts.IContextService;
import
org.jkiss.dbeaver.model.runtime.features.DBRFeature
;
import
org.jkiss.dbeaver.model.runtime.features.DBRFeatureRegistry
;
import
org.jkiss.dbeaver.model.struct.DBSDataContainer
;
import
org.jkiss.dbeaver.ui.ActionUtils
;
import
org.jkiss.dbeaver.ui.DBeaverUIConstants
;
import
org.jkiss.dbeaver.ui.actions.DataSourcePropertyTester
;
import
org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer
;
import
org.jkiss.dbeaver.ui.editors.entity.EntityEditor
;
import
org.jkiss.dbeaver.ui.editors.sql.SQLEditorBase
;
...
...
@@ -198,7 +198,7 @@ class WorkbenchContextListener implements IWindowListener, IPageListener, IPartL
activationResults
=
contextService
.
activateContext
(
RESULTS_CONTEXT_ID
);
}
// Refresh auto-commit element state (#3315)
DataSourcePropertyTester
.
fireCommandRefresh
(
CoreCommands
.
CMD_TOGGLE_AUTOCOMMIT
);
ActionUtils
.
fireCommandRefresh
(
CoreCommands
.
CMD_TOGGLE_AUTOCOMMIT
);
}
finally
{
contextService
.
deferUpdates
(
false
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/sql/SQLPresentationDescriptor.java
浏览文件 @
e93c02ef
...
...
@@ -22,7 +22,6 @@ import org.jkiss.dbeaver.DBException;
import
org.jkiss.dbeaver.model.DBPImage
;
import
org.jkiss.dbeaver.registry.AbstractContextDescriptor
;
import
org.jkiss.dbeaver.registry.RegistryConstants
;
import
org.jkiss.dbeaver.runtime.sql.SQLControlCommandHandler
;
import
org.jkiss.dbeaver.ui.editors.sql.SQLEditorPresentation
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -35,18 +34,12 @@ public class SQLPresentationDescriptor extends AbstractContextDescriptor {
public
static
final
String
EXTENSION_ID
=
"org.jkiss.dbeaver.sqlPresentation"
;
//$NON-NLS-1$
public
enum
ActivationType
{
HIDDEN
,
VISIBLE
,
MAXIMIZED
,
}
private
final
String
id
;
private
final
String
label
;
private
final
String
description
;
private
final
ObjectType
implClass
;
private
final
DBPImage
icon
;
private
final
ActivationType
activationType
;
private
final
SQLEditorPresentation
.
ActivationType
activationType
;
public
SQLPresentationDescriptor
(
IConfigurationElement
config
)
{
...
...
@@ -58,9 +51,9 @@ public class SQLPresentationDescriptor extends AbstractContextDescriptor {
this
.
icon
=
iconToImage
(
config
.
getAttribute
(
RegistryConstants
.
ATTR_ICON
));
String
activationStr
=
config
.
getAttribute
(
"activation"
);
if
(
CommonUtils
.
isEmpty
(
activationStr
))
{
this
.
activationType
=
ActivationType
.
HIDDEN
;
this
.
activationType
=
SQLEditorPresentation
.
ActivationType
.
HIDDEN
;
}
else
{
this
.
activationType
=
ActivationType
.
valueOf
(
activationStr
.
toUpperCase
(
Locale
.
ENGLISH
));
this
.
activationType
=
SQLEditorPresentation
.
ActivationType
.
valueOf
(
activationStr
.
toUpperCase
(
Locale
.
ENGLISH
));
}
}
...
...
@@ -80,7 +73,7 @@ public class SQLPresentationDescriptor extends AbstractContextDescriptor {
return
icon
;
}
public
ActivationType
getActivationType
()
{
public
SQLEditorPresentation
.
ActivationType
getActivationType
()
{
return
activationType
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/DataSourcePropertyTester.java
浏览文件 @
e93c02ef
...
...
@@ -19,8 +19,6 @@ package org.jkiss.dbeaver.ui.actions;
import
org.eclipse.core.expressions.PropertyTester
;
import
org.eclipse.ui.IEditorPart
;
import
org.eclipse.ui.IEditorReference
;
import
org.eclipse.ui.PlatformUI
;
import
org.eclipse.ui.commands.ICommandService
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
...
...
@@ -99,20 +97,6 @@ public class DataSourcePropertyTester extends PropertyTester
ActionUtils
.
evaluatePropertyState
(
NAMESPACE
+
"."
+
propName
);
}
public
static
void
fireCommandRefresh
(
final
String
commandID
)
{
// Update commands
final
ICommandService
commandService
=
PlatformUI
.
getWorkbench
().
getService
(
ICommandService
.
class
);
if
(
commandService
!=
null
)
{
UIUtils
.
asyncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
commandService
.
refreshElements
(
commandID
,
null
);
}
});
}
}
public
static
class
QMService
implements
IPluginService
{
private
QMEventsHandler
qmHandler
;
...
...
@@ -146,7 +130,7 @@ public class DataSourcePropertyTester extends PropertyTester
// Fire transactional mode change
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTIONAL
);
DataSourcePropertyTester
.
firePropertyChange
(
DataSourcePropertyTester
.
PROP_TRANSACTION_ACTIVE
);
DataSourcePropertyTester
.
fireCommandRefresh
(
CoreCommands
.
CMD_TOGGLE_AUTOCOMMIT
);
ActionUtils
.
fireCommandRefresh
(
CoreCommands
.
CMD_TOGGLE_AUTOCOMMIT
);
}
});
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
浏览文件 @
e93c02ef
...
...
@@ -36,7 +36,6 @@ import org.eclipse.osgi.util.NLS;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.custom.CTabFolder
;
import
org.eclipse.swt.custom.CTabItem
;
import
org.eclipse.swt.custom.SashForm
;
import
org.eclipse.swt.custom.StyledText
;
import
org.eclipse.swt.events.MouseAdapter
;
import
org.eclipse.swt.events.MouseEvent
;
...
...
@@ -142,7 +141,7 @@ public class SQLEditor extends SQLEditorBase implements
private
static
Image
IMG_OUTPUT
=
DBeaverIcons
.
getImage
(
UIIcon
.
SQL_PAGE_OUTPUT
);
private
static
Image
IMG_OUTPUT_ALERT
=
DBeaverIcons
.
getImage
(
UIIcon
.
SQL_PAGE_OUTPUT_ALERT
);
private
static
final
String
TOOLBAR_CONTRIBUTION_ID
=
"toolbar:org.jkiss.dbeaver.ui.editors.sql.toolbar.s
witch
"
;
private
static
final
String
TOOLBAR_CONTRIBUTION_ID
=
"toolbar:org.jkiss.dbeaver.ui.editors.sql.toolbar.s
ide
"
;
private
static
final
String
TOOLBAR_GROUP_ADDITIONS
=
IWorkbenchActionConstants
.
MB_ADDITIONS
;
public
static
final
String
VAR_CONNECTION_NAME
=
"connectionName"
;
...
...
@@ -156,7 +155,6 @@ public class SQLEditor extends SQLEditorBase implements
private
CustomSashForm
resultsSash
;
@Nullable
private
CustomSashForm
presentationSash
;
private
Control
editorControl
;
private
CTabFolder
resultTabs
;
private
SQLLogPanel
logViewer
;
...
...
@@ -176,7 +174,7 @@ public class SQLEditor extends SQLEditorBase implements
private
final
List
<
SQLQuery
>
runningQueries
=
new
ArrayList
<>();
private
QueryResultsContainer
curResultsContainer
;
private
Image
editorImage
;
private
ToolBarManager
views
ToolBar
;
private
ToolBarManager
side
ToolBar
;
private
SQLPresentationDescriptor
extraPresentationDescriptor
;
private
SQLEditorPresentation
extraPresentation
;
...
...
@@ -355,7 +353,7 @@ public class SQLEditor extends SQLEditorBase implements
private
class
OutputLogWriter
extends
Writer
{
@Override
public
void
write
(
@NotNull
final
char
[]
cbuf
,
final
int
off
,
final
int
len
)
throws
IOException
{
public
void
write
(
@NotNull
final
char
[]
cbuf
,
final
int
off
,
final
int
len
)
{
UIUtils
.
syncExec
(()
->
{
if
(!
outputViewer
.
isDisposed
())
{
outputViewer
.
getOutputWriter
().
write
(
cbuf
,
off
,
len
);
...
...
@@ -496,42 +494,47 @@ public class SQLEditor extends SQLEditorBase implements
resultsSash
.
setSashWidth
(
5
);
UIUtils
.
setHelp
(
resultsSash
,
IHelpContextIds
.
CTX_SQL_EDITOR
);
SashForm
editorSash
=
resultsSash
;
Composite
editorContainer
;
Composite
sqlEditorPanel
=
UIUtils
.
createPlaceholder
(
resultsSash
,
2
,
0
);
createSideBar
(
sqlEditorPanel
);
// divides SQL editor presentations
extraPresentationDescriptor
=
SQLPresentationRegistry
.
getInstance
().
getPresentation
(
this
);
if
(
extraPresentationDescriptor
!=
null
)
{
presentationSash
=
UIUtils
.
createPartDivider
(
this
,
resultsSash
,
sqlEditorPanel
,
((
resultSetOrientation
.
getSashOrientation
()
==
SWT
.
VERTICAL
)
?
SWT
.
HORIZONTAL
:
SWT
.
VERTICAL
)
|
SWT
.
SMOOTH
);
presentationSash
.
setSashWidth
(
5
);
editorSash
=
presentationSash
;
presentationSash
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
editorContainer
=
presentationSash
;
}
else
{
editorContainer
=
sqlEditorPanel
;
}
super
.
createPartControl
(
editorSash
);
super
.
createPartControl
(
editorContainer
);
getEditorControlWrapper
().
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
if
(
extraPresentationDescriptor
!=
null
)
{
Composite
pPlaceholder
=
new
Composite
(
editor
Sash
,
SWT
.
NONE
);
Composite
pPlaceholder
=
new
Composite
(
presentation
Sash
,
SWT
.
NONE
);
pPlaceholder
.
setLayout
(
new
FillLayout
());
switch
(
extraPresentationDescriptor
.
getActivationType
())
{
case
HIDDEN:
editorSash
.
setMaximizedControl
(
editor
Sash
.
getChildren
()[
0
]);
presentationSash
.
setMaximizedControl
(
presentation
Sash
.
getChildren
()[
0
]);
break
;
case
MAXIMIZED:
case
VISIBLE:
extraPresentation
.
createPresentation
(
pPlaceholder
,
this
);
if
(
extraPresentationDescriptor
.
getActivationType
()
==
SQL
PresentationDescriptor
.
ActivationType
.
MAXIMIZED
)
{
if
(
editor
Sash
.
getChildren
()[
1
]
!=
null
)
{
editor
Sash
.
setMaximizedControl
(
pPlaceholder
);
if
(
extraPresentationDescriptor
.
getActivationType
()
==
SQL
EditorPresentation
.
ActivationType
.
MAXIMIZED
)
{
if
(
presentation
Sash
.
getChildren
()[
1
]
!=
null
)
{
presentation
Sash
.
setMaximizedControl
(
pPlaceholder
);
}
}
break
;
}
}
editorControl
=
editorSash
.
getChildren
()[
0
];
getSite
().
setSelectionProvider
(
new
DynamicSelectionProvider
());
createResultTabs
();
...
...
@@ -557,6 +560,29 @@ public class SQLEditor extends SQLEditorBase implements
UIUtils
.
asyncExec
(
this
::
onDataSourceChange
);
}
private
void
createSideBar
(
Composite
sqlEditorPanel
)
{
sideToolBar
=
new
ToolBarManager
(
SWT
.
VERTICAL
);
sideToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_EXECUTE_STATEMENT
));
sideToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_EXECUTE_STATEMENT_NEW
));
sideToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_EXECUTE_SCRIPT
));
sideToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_EXECUTE_SCRIPT_NEW
));
sideToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_EXPLAIN_PLAN
));
sideToolBar
.
add
(
new
GroupMarker
(
TOOLBAR_GROUP_ADDITIONS
));
sideToolBar
.
add
(
new
Separator
());
sideToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_SQL_SHOW_OUTPUT
,
CommandContributionItem
.
STYLE_CHECK
));
sideToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_SQL_SHOW_LOG
,
CommandContributionItem
.
STYLE_CHECK
));
final
IMenuService
menuService
=
getSite
().
getService
(
IMenuService
.
class
);
if
(
menuService
!=
null
)
{
menuService
.
populateContributionManager
(
sideToolBar
,
TOOLBAR_CONTRIBUTION_ID
);
}
sideToolBar
.
update
(
true
);
ToolBar
toolBar
=
sideToolBar
.
createControl
(
sqlEditorPanel
);
GridData
gd
=
new
GridData
(
GridData
.
FILL_VERTICAL
|
GridData
.
VERTICAL_ALIGN_BEGINNING
);
gd
.
verticalIndent
=
5
;
toolBar
.
setLayoutData
(
gd
);
}
/**
* Sets focus in current editor.
* This function is called on drag-n-drop and some other operations
...
...
@@ -619,23 +645,6 @@ public class SQLEditor extends SQLEditorBase implements
});
resultTabs
.
setSimple
(
true
);
//resultTabs.setMRUVisible(true);
{
viewsToolBar
=
new
ToolBarManager
(
SWT
.
HORIZONTAL
|
SWT
.
RIGHT
|
SWT
.
WRAP
);
viewsToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_SQL_SHOW_OUTPUT
,
CommandContributionItem
.
STYLE_CHECK
,
CoreMessages
.
sql_editor_resultset_tool_item_log
,
null
,
null
,
true
));
viewsToolBar
.
add
(
ActionUtils
.
makeCommandContribution
(
getSite
(),
CoreCommands
.
CMD_SQL_SHOW_LOG
,
CommandContributionItem
.
STYLE_CHECK
,
CoreMessages
.
sql_editor_resultset_tool_item_output
,
null
,
null
,
true
));
viewsToolBar
.
add
(
new
GroupMarker
(
TOOLBAR_GROUP_ADDITIONS
));
final
IMenuService
menuService
=
getSite
().
getService
(
IMenuService
.
class
);
if
(
menuService
!=
null
)
{
menuService
.
populateContributionManager
(
viewsToolBar
,
TOOLBAR_CONTRIBUTION_ID
);
}
viewsToolBar
.
update
(
true
);
resultTabs
.
setTopRight
(
viewsToolBar
.
createControl
(
resultTabs
));
}
resultTabs
.
addMouseListener
(
new
MouseAdapter
()
{
@Override
public
void
mouseUp
(
MouseEvent
e
)
{
...
...
@@ -760,7 +769,7 @@ public class SQLEditor extends SQLEditorBase implements
private
ToolItem
getViewToolItem
(
String
commandId
)
{
ToolItem
viewItem
=
null
;
for
(
ToolItem
item
:
views
ToolBar
.
getControl
().
getItems
())
{
for
(
ToolItem
item
:
side
ToolBar
.
getControl
().
getItems
())
{
Object
data
=
item
.
getData
();
if
(
data
instanceof
CommandContributionItem
)
{
if
(((
CommandContributionItem
)
data
).
getCommand
()
!=
null
&&
commandId
.
equals
(((
CommandContributionItem
)
data
).
getCommand
().
getId
()))
{
...
...
@@ -797,9 +806,18 @@ public class SQLEditor extends SQLEditorBase implements
return
resultsSash
.
getMaximizedControl
()
!=
null
;
}
public
boolean
isExtraPresentationVisible
()
{
return
extraPresentation
!=
null
&&
(
presentationSash
.
getMaximizedControl
()
==
null
||
presentationSash
.
getMaximizedControl
()
==
getExtraPresentationControl
());
public
SQLEditorPresentation
.
ActivationType
getExtraPresentationState
()
{
if
(
extraPresentation
==
null
)
{
return
SQLEditorPresentation
.
ActivationType
.
HIDDEN
;
}
Control
maximizedControl
=
presentationSash
.
getMaximizedControl
();
if
(
maximizedControl
==
getExtraPresentationControl
())
{
return
SQLEditorPresentation
.
ActivationType
.
MAXIMIZED
;
}
else
if
(
maximizedControl
==
getEditorControlWrapper
())
{
return
SQLEditorPresentation
.
ActivationType
.
HIDDEN
;
}
else
{
return
SQLEditorPresentation
.
ActivationType
.
VISIBLE
;
}
}
public
void
showExtraPresentation
(
boolean
show
,
boolean
maximize
)
{
...
...
@@ -808,9 +826,9 @@ public class SQLEditor extends SQLEditorBase implements
}
if
(!
show
)
{
boolean
epHasFocus
=
UIUtils
.
hasFocus
(
getExtraPresentationControl
());
presentationSash
.
setMaximizedControl
(
editorControl
);
presentationSash
.
setMaximizedControl
(
presentationSash
.
getChildren
()[
0
]
);
if
(
epHasFocus
)
{
editorControl
.
setFocus
();
getEditorControlWrapper
()
.
setFocus
();
}
}
else
{
if
(
extraPresentation
==
null
)
{
...
...
@@ -868,7 +886,7 @@ public class SQLEditor extends SQLEditorBase implements
}
}
}
else
{
editorControl
.
setFocus
();
getEditorControlWrapper
()
.
setFocus
();
}
}
...
...
@@ -903,7 +921,7 @@ public class SQLEditor extends SQLEditorBase implements
}
@Override
protected
void
doSetInput
(
IEditorInput
editorInput
)
throws
CoreException
protected
void
doSetInput
(
IEditorInput
editorInput
)
{
// Check for file existence
try
{
...
...
@@ -1350,7 +1368,7 @@ public class SQLEditor extends SQLEditorBase implements
reloadSyntaxRules
();
if
(
getDataSourceContainer
()
==
null
)
{
resultsSash
.
setMaximizedControl
(
editorControl
);
resultsSash
.
setMaximizedControl
(
getEditorControlWrapper
()
);
}
else
{
resultsSash
.
setMaximizedControl
(
null
);
}
...
...
@@ -2287,7 +2305,7 @@ public class SQLEditor extends SQLEditorBase implements
return
;
}
if
(
getActivePreferenceStore
().
getBoolean
(
SQLPreferenceConstants
.
MAXIMIZE_EDITOR_ON_SCRIPT_EXECUTE
))
{
resultsSash
.
setMaximizedControl
(
editorControl
);
resultsSash
.
setMaximizedControl
(
getEditorControlWrapper
()
);
}
});
}
finally
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorBase.java
浏览文件 @
e93c02ef
...
...
@@ -109,6 +109,7 @@ public abstract class SQLEditorBase extends BaseTextEditor implements IErrorVisu
private
boolean
hasVerticalRuler
=
true
;
private
SQLTemplatesPage
templatesPage
;
private
IPropertyChangeListener
themeListener
;
private
SQLEditorControl
editorControl
;
public
SQLEditorBase
()
{
...
...
@@ -211,7 +212,8 @@ public abstract class SQLEditorBase extends BaseTextEditor implements IErrorVisu
{
setRangeIndicator
(
new
DefaultRangeIndicator
());
super
.
createPartControl
(
new
SQLEditorControl
(
parent
,
this
));
editorControl
=
new
SQLEditorControl
(
parent
,
this
);
super
.
createPartControl
(
editorControl
);
ProjectionViewer
viewer
=
(
ProjectionViewer
)
getSourceViewer
();
projectionSupport
=
new
ProjectionSupport
(
...
...
@@ -271,6 +273,10 @@ public abstract class SQLEditorBase extends BaseTextEditor implements IErrorVisu
}
}
public
SQLEditorControl
getEditorControlWrapper
()
{
return
editorControl
;
}
@Override
public
void
updatePartControl
(
IEditorInput
input
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorContributor.java
浏览文件 @
e93c02ef
...
...
@@ -155,19 +155,7 @@ public class SQLEditorContributor extends TextEditorActionContributor
@Override
public
void
contributeToToolBar
(
IToolBarManager
manager
)
{
if
(!
isNestedEditor
())
{
super
.
contributeToToolBar
(
manager
);
if
(
manager
.
find
(
CoreCommands
.
CMD_EXECUTE_STATEMENT
)
==
null
)
{
manager
.
add
(
ActionUtils
.
makeCommandContribution
(
getPage
().
getWorkbenchWindow
(),
CoreCommands
.
CMD_EXECUTE_STATEMENT
));
manager
.
add
(
ActionUtils
.
makeCommandContribution
(
getPage
().
getWorkbenchWindow
(),
CoreCommands
.
CMD_EXECUTE_STATEMENT_NEW
));
manager
.
add
(
ActionUtils
.
makeCommandContribution
(
getPage
().
getWorkbenchWindow
(),
CoreCommands
.
CMD_EXECUTE_SCRIPT
));
manager
.
add
(
ActionUtils
.
makeCommandContribution
(
getPage
().
getWorkbenchWindow
(),
CoreCommands
.
CMD_EXECUTE_SCRIPT_NEW
));
//manager.add(new Separator());
manager
.
add
(
ActionUtils
.
makeCommandContribution
(
getPage
().
getWorkbenchWindow
(),
CoreCommands
.
CMD_EXPLAIN_PLAN
));
//manager.add(ActionUtils.makeCommandContribution(getPage().getWorkbenchWindow(), CoreCommands.CMD_ANALYSE_STATEMENT));
//manager.add(ActionUtils.makeCommandContribution(getPage().getWorkbenchWindow(), CoreCommands.CMD_VALIDATE_STATEMENT));
}
}
// Nothing here. All contributions moved to editor side bar
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorPresentation.java
浏览文件 @
e93c02ef
...
...
@@ -22,4 +22,9 @@ public interface SQLEditorPresentation {
void
createPresentation
(
Composite
parent
,
SQLEditor
editor
);
enum
ActivationType
{
HIDDEN
,
VISIBLE
,
MAXIMIZED
,
}
}
plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/ActionUtils.java
浏览文件 @
e93c02ef
...
...
@@ -313,4 +313,12 @@ public class ActionUtils
}
}
public
static
void
fireCommandRefresh
(
final
String
commandID
)
{
// Update commands
final
ICommandService
commandService
=
PlatformUI
.
getWorkbench
().
getService
(
ICommandService
.
class
);
if
(
commandService
!=
null
)
{
UIUtils
.
asyncExec
(()
->
commandService
.
refreshElements
(
commandID
,
null
));
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录