Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
6ab18588
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,发现更多精彩内容 >>
提交
6ab18588
编写于
2月 14, 2017
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Transaction monitor toolbar
上级
e2b8dd0e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
140 addition
and
11 deletion
+140
-11
plugins/org.jkiss.dbeaver.core/plugin.xml
plugins/org.jkiss.dbeaver.core/plugin.xml
+11
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
....jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
+10
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceAutoCommitHandler.java
...er/ui/actions/datasource/DataSourceAutoCommitHandler.java
+0
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/txn/TransactionMonitorToolbar.java
...ss/dbeaver/ui/controls/txn/TransactionMonitorToolbar.java
+116
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/binary/HexEditControl.java
...c/org/jkiss/dbeaver/ui/editors/binary/HexEditControl.java
+2
-1
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
...rg/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.core/plugin.xml
浏览文件 @
6ab18588
...
...
@@ -1594,8 +1594,18 @@
<command
commandId=
"org.jkiss.dbeaver.core.txn.autocommit"
icon=
"icons/sql/txn_auto.png"
style=
"pulldown"
id=
"org.jkiss.dbeaver.core.menu.txn"
>
<visibleWhen><reference
definitionId=
"org.jkiss.dbeaver.core.ui.datasource.editor"
/></visibleWhen>
</command>
<separator
name=
"additions"
visible=
"false"
/>
<control
class=
"org.jkiss.dbeaver.ui.controls.txn.TransactionMonitorToolbar$ToolbarContribution"
>
<visibleWhen><reference
definitionId=
"org.jkiss.dbeaver.core.ui.datasource.editor"
/></visibleWhen>
</control>
</toolbar>
<!--
<toolbar id="dbeaver-transaction-monitor" label="Transaction monitor">
<visibleWhen><reference definitionId="org.jkiss.dbeaver.core.ui.datasource.editor"/></visibleWhen>
<control class="org.jkiss.dbeaver.ui.controls.txn.TransactionMonitorToolbar$ToolbarContribution">
<visibleWhen><reference definitionId="org.jkiss.dbeaver.core.ui.datasource.editor"/></visibleWhen>
</control>
</toolbar>
-->
<toolbar
id=
"dbeaver-datasource-selector"
label=
"DataSource Selector"
>
<control
class=
"org.jkiss.dbeaver.ui.perspective.DataSourceManagementToolbar$ToolbarContribution"
>
<visibleWhen><reference
definitionId=
"org.jkiss.dbeaver.core.ui.datasource.editor"
/></visibleWhen>
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
浏览文件 @
6ab18588
...
...
@@ -454,7 +454,15 @@ public class UIUtils {
}
public
static
int
getFontHeight
(
Control
control
)
{
return
control
.
getFont
().
getFontData
()[
0
].
getHeight
();
return
getFontHeight
(
control
.
getFont
());
}
public
static
int
getFontHeight
(
Font
font
)
{
FontData
[]
fontData
=
font
.
getFontData
();
if
(
fontData
.
length
==
0
)
{
return
20
;
}
return
fontData
[
0
].
getHeight
();
}
public
static
Font
makeBoldFont
(
Font
normalFont
)
...
...
@@ -1579,4 +1587,5 @@ public class UIUtils {
item
.
setPreferredSize
(
preferred
);
return
item
;
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/actions/datasource/DataSourceAutoCommitHandler.java
浏览文件 @
6ab18588
...
...
@@ -61,13 +61,6 @@ public class DataSourceAutoCommitHandler extends AbstractDataSourceHandler imple
public
void
run
()
{
// Save config
container
.
persistConfiguration
();
DBeaverUI
.
syncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
// Update actions
DataSourcePropertyTester
.
fireCommandRefresh
(
CoreCommands
.
CMD_TOGGLE_AUTOCOMMIT
);
}
});
}
});
}
catch
(
DBException
e
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/txn/TransactionMonitorToolbar.java
0 → 100644
浏览文件 @
6ab18588
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ui.controls.txn
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.PaintEvent
;
import
org.eclipse.swt.events.PaintListener
;
import
org.eclipse.swt.graphics.Point
;
import
org.eclipse.swt.layout.FillLayout
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.Text
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.eclipse.ui.menus.WorkbenchWindowControlContribution
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.ui.IActionConstants
;
import
org.jkiss.dbeaver.ui.UIUtils
;
/**
* DataSource Toolbar
*/
public
class
TransactionMonitorToolbar
{
private
static
final
Log
log
=
Log
.
getLog
(
TransactionMonitorToolbar
.
class
);
private
IWorkbenchWindow
workbenchWindow
;
public
TransactionMonitorToolbar
(
IWorkbenchWindow
workbenchWindow
)
{
this
.
workbenchWindow
=
workbenchWindow
;
}
/*
private void dispose() {
IWorkbenchPage activePage = workbenchWindow.getActivePage();
if (activePage != null) {
pageClosed(activePage);
}
this.workbenchWindow.removePageListener(this);
}
*/
private
Control
createControl
(
Composite
parent
)
{
return
new
MonitorPanel
(
parent
);
}
private
class
MonitorPanel
extends
Composite
{
private
final
Text
txnText
;
public
MonitorPanel
(
Composite
parent
)
{
super
(
parent
,
SWT
.
NONE
);
//setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
setCursor
(
parent
.
getDisplay
().
getSystemCursor
(
SWT
.
CURSOR_HAND
));
addPaintListener
(
new
PaintListener
()
{
@Override
public
void
paintControl
(
PaintEvent
e
)
{
paint
(
e
);
}
});
GridLayout
layout
=
new
GridLayout
(
1
,
false
);
layout
.
marginHeight
=
0
;
//layout.marginWidth = 0;
setLayout
(
layout
);
txnText
=
new
Text
(
this
,
SWT
.
BORDER
|
SWT
.
SINGLE
);
txnText
.
setEnabled
(
false
);
txnText
.
setBackground
(
parent
.
getDisplay
().
getSystemColor
(
SWT
.
COLOR_WIDGET_BACKGROUND
));
txnText
.
setCursor
(
parent
.
getDisplay
().
getSystemCursor
(
SWT
.
CURSOR_HAND
));
txnText
.
setText
(
""
);
GridData
gd
=
new
GridData
();
gd
.
verticalAlignment
=
GridData
.
CENTER
;
gd
.
grabExcessVerticalSpace
=
true
;
gd
.
widthHint
=
UIUtils
.
getFontHeight
(
txnText
)
*
6
;
txnText
.
setLayoutData
(
gd
);
}
private
void
paint
(
PaintEvent
e
)
{
//e.gc.drawRectangle(e.x, e.y, e.width, e.height);
}
@Override
public
Point
computeSize
(
int
wHint
,
int
hHint
,
boolean
changed
)
{
return
super
.
computeSize
(
wHint
,
hHint
,
changed
);
}
}
public
static
class
ToolbarContribution
extends
WorkbenchWindowControlContribution
{
public
ToolbarContribution
()
{
super
(
IActionConstants
.
TOOLBAR_TXN
);
}
@Override
protected
Control
createControl
(
Composite
parent
)
{
TransactionMonitorToolbar
toolbar
=
new
TransactionMonitorToolbar
(
DBeaverUI
.
getActiveWorkbenchWindow
());
return
toolbar
.
createControl
(
parent
);
}
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/binary/HexEditControl.java
浏览文件 @
6ab18588
...
...
@@ -27,6 +27,7 @@ import org.eclipse.swt.layout.GridLayout;
import
org.eclipse.swt.widgets.*
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.utils.GeneralUtils
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -1856,7 +1857,7 @@ public class HexEditControl extends Composite {
// very small sizes would compromise responsiveness in large windows, and they are too small
// to see anyway
if
(
font
!=
null
)
{
int
newSize
=
font
.
getFontData
()[
0
].
getHeight
(
);
int
newSize
=
UIUtils
.
getFontHeight
(
font
);
if
(
newSize
==
1
||
newSize
==
2
)
throw
new
IllegalArgumentException
(
"Font size is "
+
newSize
+
", too small"
);
}
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
浏览文件 @
6ab18588
...
...
@@ -80,7 +80,7 @@ public class MySQLConnectionPage extends ConnectionPageAbstract implements IComp
}
}
};
final
int
fontHeight
=
composite
.
getFont
().
getFontData
()[
0
].
getHeight
(
);
final
int
fontHeight
=
UIUtils
.
getFontHeight
(
composite
);
Composite
addrGroup
=
UIUtils
.
createPlaceholder
(
composite
,
2
);
GridLayout
gl
=
new
GridLayout
(
2
,
false
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录