Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
515c68d3
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,发现更多精彩内容 >>
提交
515c68d3
编写于
4月 09, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#3236 QM log colors and transaction monitor background color configuration
上级
a3418284
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
86 addition
and
57 deletion
+86
-57
plugins/org.jkiss.dbeaver.core/OSGI-INF/l10n/bundle.properties
...ns/org.jkiss.dbeaver.core/OSGI-INF/l10n/bundle.properties
+9
-0
plugins/org.jkiss.dbeaver.core/plugin.xml
plugins/org.jkiss.dbeaver.core/plugin.xml
+47
-15
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/querylog/QueryLogViewer.java
...rg/jkiss/dbeaver/ui/controls/querylog/QueryLogViewer.java
+11
-13
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/txn/TransactionMonitorToolbar.java
...ss/dbeaver/ui/controls/txn/TransactionMonitorToolbar.java
+19
-29
未找到文件。
plugins/org.jkiss.dbeaver.core/OSGI-INF/l10n/bundle.properties
浏览文件 @
515c68d3
...
...
@@ -500,6 +500,8 @@ themeElementCategory.org.jkiss.dbeaver.ui.presentation.sql.description = SQL Edi
themeElementCategory.org.jkiss.dbeaver.ui.presentation.results.label
=
Database Query Results
themeElementCategory.org.jkiss.dbeaver.ui.presentation.datatypes.label
=
Resultset Data Types
themeElementCategory.org.jkiss.dbeaver.ui.presentation.results.description
=
SQL Editor
themeElementCategory.org.jkiss.dbeaver.ui.presentation.txn.label
=
Transactions
themeElementCategory.org.jkiss.dbeaver.ui.presentation.txn.description
=
Transactions colors
fontDefinition.org.jkiss.dbeaver.sql.resultset.font.label
=
Results grid font
fontDefinition.org.jkiss.dbeaver.sql.resultset.font.description
=
The grid font is used for result set cells, header and rows number.
...
...
@@ -569,6 +571,13 @@ colorDefinition.org.jkiss.dbeaver.sql.editor.color.text.background.description =
colorDefinition.org.jkiss.dbeaver.sql.editor.color.disabled.background.label
=
SQL disabled background
colorDefinition.org.jkiss.dbeaver.sql.editor.color.disabled.background.description
=
SQL text background
colorDefinition.org.jkiss.dbeaver.txn.color.committed.background.label
=
Committed transaction
colorDefinition.org.jkiss.dbeaver.txn.color.committed.background.description
=
Committed transaction background
colorDefinition.org.jkiss.dbeaver.txn.color.reverted.background.label
=
Reverted transaction
colorDefinition.org.jkiss.dbeaver.txn.color.reverted.background.description
=
Reverted transaction background
colorDefinition.org.jkiss.dbeaver.txn.color.transaction.background.label
=
Active transaction
colorDefinition.org.jkiss.dbeaver.txn.color.transaction.background.description
=
Active transaction background
category.org.jkiss.dbeaver.core.export.resources.name
=
DBeaver
wizard.org.jkiss.dbeaver.core.wizard.export.project.name
=
Project
wizard.org.jkiss.dbeaver.core.wizard.export.project.description
=
DBeaver Project
...
...
plugins/org.jkiss.dbeaver.core/plugin.xml
浏览文件 @
515c68d3
...
...
@@ -2833,27 +2833,14 @@
</extension>
<extension
point=
"org.eclipse.ui.themes"
>
<themeElementCategory
label=
"%themeElementCategory.org.jkiss.dbeaver.ui.presentation.sql.label"
id=
"org.jkiss.dbeaver.ui.presentation.sql"
>
<description>
%themeElementCategory.org.jkiss.dbeaver.ui.presentation.sql.description
</description>
</themeElementCategory>
<themeElementCategory
label=
"%themeElementCategory.org.jkiss.dbeaver.ui.presentation.results.label"
id=
"org.jkiss.dbeaver.ui.presentation.results"
>
<description>
%themeElementCategory.org.jkiss.dbeaver.ui.presentation.results.description
</description>
</themeElementCategory>
<themeElementCategory
label=
"%themeElementCategory.org.jkiss.dbeaver.ui.presentation.datatypes.label"
id=
"org.jkiss.dbeaver.ui.presentation.results.datatypes"
parentId=
"org.jkiss.dbeaver.ui.presentation.results"
>
<description>
%themeElementCategory.org.jkiss.dbeaver.ui.presentation.datatypes.description
</description>
</themeElementCategory>
<fontDefinition
id=
"org.jkiss.dbeaver.sql.resultset.font"
categoryId=
"org.jkiss.dbeaver.ui.presentation.results"
label=
"%fontDefinition.org.jkiss.dbeaver.sql.resultset.font.label"
>
<description>
%fontDefinition.org.jkiss.dbeaver.sql.resultset.font.description
</description>
</fontDefinition>
<fontDefinition
id=
"org.jkiss.dbeaver.sql.editor.font.output"
categoryId=
"org.jkiss.dbeaver.ui.presentation.sql"
label=
"%fontDefinition.org.jkiss.dbeaver.sql.editor.font.output.label"
value=
"Courier New-regular-10"
>
<description>
%fontDefinition.org.jkiss.dbeaver.sql.editor.font.output.description
</description>
<fontValue
os=
"linux"
value=
"Monospace-regular-10"
/>
<fontValue
os=
"macosx"
value=
"Courier-regular-11"
/>
</fontDefinition>
<colorDefinition
label=
"%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.selection.background.label"
categoryId=
"org.jkiss.dbeaver.ui.presentation.results"
...
...
@@ -2961,6 +2948,10 @@
</colorDefinition>
<!-- Colors for data types -->
<themeElementCategory
label=
"%themeElementCategory.org.jkiss.dbeaver.ui.presentation.datatypes.label"
id=
"org.jkiss.dbeaver.ui.presentation.results.datatypes"
parentId=
"org.jkiss.dbeaver.ui.presentation.results"
>
<description>
%themeElementCategory.org.jkiss.dbeaver.ui.presentation.datatypes.description
</description>
</themeElementCategory>
<colorDefinition
label=
"%colorDefinition.org.jkiss.dbeaver.sql.resultset.color.binary.foreground.label"
categoryId=
"org.jkiss.dbeaver.ui.presentation.results.datatypes"
...
...
@@ -2998,6 +2989,20 @@
</colorDefinition>
<!-- Colors for SQL editor -->
<themeElementCategory
label=
"%themeElementCategory.org.jkiss.dbeaver.ui.presentation.sql.label"
id=
"org.jkiss.dbeaver.ui.presentation.sql"
>
<description>
%themeElementCategory.org.jkiss.dbeaver.ui.presentation.sql.description
</description>
</themeElementCategory>
<fontDefinition
id=
"org.jkiss.dbeaver.sql.editor.font.output"
categoryId=
"org.jkiss.dbeaver.ui.presentation.sql"
label=
"%fontDefinition.org.jkiss.dbeaver.sql.editor.font.output.label"
value=
"Courier New-regular-10"
>
<description>
%fontDefinition.org.jkiss.dbeaver.sql.editor.font.output.description
</description>
<fontValue
os=
"linux"
value=
"Monospace-regular-10"
/>
<fontValue
os=
"macosx"
value=
"Courier-regular-11"
/>
</fontDefinition>
<colorDefinition
label=
"%colorDefinition.org.jkiss.dbeaver.sql.editor.color.keyword.foreground.label"
categoryId=
"org.jkiss.dbeaver.ui.presentation.sql"
...
...
@@ -3076,6 +3081,33 @@
<description>
%colorDefinition.org.jkiss.dbeaver.sql.editor.color.disabled.background.description
</description>
</colorDefinition>
<!-- Colors for transactions -->
<themeElementCategory
label=
"%themeElementCategory.org.jkiss.dbeaver.ui.presentation.txn.label"
id=
"org.jkiss.dbeaver.ui.presentation.qm"
>
<description>
%themeElementCategory.org.jkiss.dbeaver.ui.presentation.txn.description
</description>
</themeElementCategory>
<colorDefinition
label=
"%colorDefinition.org.jkiss.dbeaver.txn.color.committed.background.label"
categoryId=
"org.jkiss.dbeaver.ui.presentation.qm"
id=
"org.jkiss.dbeaver.txn.color.committed.background"
value=
"189, 254, 191"
>
<description>
%colorDefinition.org.jkiss.dbeaver.txn.color.committed.background.description
</description>
</colorDefinition>
<colorDefinition
label=
"%colorDefinition.org.jkiss.dbeaver.txn.color.reverted.background.label"
categoryId=
"org.jkiss.dbeaver.ui.presentation.qm"
id=
"org.jkiss.dbeaver.txn.color.reverted.background"
value=
"255, 99, 71"
>
<description>
%colorDefinition.org.jkiss.dbeaver.txn.color.reverted.background.description
</description>
</colorDefinition>
<colorDefinition
label=
"%colorDefinition.org.jkiss.dbeaver.txn.color.transaction.background.label"
categoryId=
"org.jkiss.dbeaver.ui.presentation.qm"
id=
"org.jkiss.dbeaver.txn.color.transaction.background"
value=
"255, 228, 181"
>
<description>
%colorDefinition.org.jkiss.dbeaver.txn.color.transaction.background.description
</description>
</colorDefinition>
</extension>
<extension
point=
"org.eclipse.ui.exportWizards"
>
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/querylog/QueryLogViewer.java
浏览文件 @
515c68d3
...
...
@@ -27,7 +27,7 @@ import org.eclipse.jface.action.MenuManager;
import
org.eclipse.jface.action.Separator
;
import
org.eclipse.jface.dialogs.IDialogConstants
;
import
org.eclipse.jface.dialogs.IDialogSettings
;
import
org.eclipse.jface.
text.source.ISharedTextColors
;
import
org.eclipse.jface.
resource.ColorRegistry
;
import
org.eclipse.jface.viewers.ISelection
;
import
org.eclipse.jface.viewers.IStructuredSelection
;
import
org.eclipse.jface.viewers.StructuredSelection
;
...
...
@@ -39,7 +39,6 @@ import org.eclipse.swt.events.SelectionAdapter;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.graphics.Color
;
import
org.eclipse.swt.graphics.Font
;
import
org.eclipse.swt.graphics.RGB
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.*
;
...
...
@@ -88,11 +87,9 @@ public class QueryLogViewer extends Viewer implements QMMetaListener, DBPPrefere
private
static
final
String
VIEWER_ID
=
"DBeaver.QM.LogViewer"
;
private
static
final
int
MIN_ENTRIES_PER_PAGE
=
1
;
public
static
final
RGB
COLOR_LIGHT_GREEN
=
new
RGB
(
0xBD
,
0xFE
,
0xBF
);
//189, 254, 191 #bdfebf
public
static
final
RGB
COLOR_LIGHT_RED
=
new
RGB
(
0xFF
,
0x63
,
0x47
);
public
static
final
RGB
COLOR_LIGHT_YELLOW
=
new
RGB
(
0xFF
,
0xE4
,
0xB5
);
public
static
final
RGB
COLOR_BLACK
=
new
RGB
(
0x00
,
0x00
,
0x00
);
public
static
final
String
COLOR_COMMITTED
=
"org.jkiss.dbeaver.txn.color.committed.background"
;
//= new RGB(0xBD, 0xFE, 0xBF);
public
static
final
String
COLOR_REVERTED
=
"org.jkiss.dbeaver.txn.color.reverted.background"
;
// = new RGB(0xFF, 0x63, 0x47);
public
static
final
String
COLOR_TRANSACTION
=
"org.jkiss.dbeaver.txn.color.transaction.background"
;
// = new RGB(0xFF, 0xE4, 0xB5);
private
static
abstract
class
LogColumn
{
private
final
String
id
;
...
...
@@ -320,7 +317,6 @@ public class QueryLogViewer extends Viewer implements QMMetaListener, DBPPrefere
private
final
Color
colorLightGreen
;
private
final
Color
colorLightRed
;
private
final
Color
colorLightYellow
;
private
final
Color
colorGray
;
private
final
Font
boldFont
;
private
DragSource
dndSource
;
...
...
@@ -334,12 +330,12 @@ public class QueryLogViewer extends Viewer implements QMMetaListener, DBPPrefere
this
.
site
=
site
;
// Prepare colors
ISharedTextColors
sharedColors
=
DBeaverUI
.
getSharedTextColors
();
colorLightGreen
=
sharedColors
.
getColor
(
COLOR_LIGHT_GREEN
);
colorLightRed
=
sharedColors
.
getColor
(
COLOR_LIGHT_RED
);
colorLightYellow
=
sharedColors
.
getColor
(
COLOR_LIGHT_YELLOW
);
colorGray
=
sharedColors
.
getColor
(
COLOR_BLACK
);
ColorRegistry
colorRegistry
=
site
.
getWorkbenchWindow
().
getWorkbench
().
getThemeManager
().
getCurrentTheme
().
getColorRegistry
();
colorLightGreen
=
colorRegistry
.
get
(
COLOR_COMMITTED
);
colorLightRed
=
colorRegistry
.
get
(
COLOR_REVERTED
);
colorLightYellow
=
colorRegistry
.
get
(
COLOR_TRANSACTION
);
boldFont
=
UIUtils
.
makeBoldFont
(
parent
.
getFont
());
boolean
inDialog
=
UIUtils
.
isInDialog
(
parent
);
...
...
@@ -532,9 +528,11 @@ public class QueryLogViewer extends Viewer implements QMMetaListener, DBPPrefere
private
Color
getObjectForeground
(
QMMetaEvent
event
)
{
/*
if (getObjectBackground(event) != null) {
return colorGray;
}
*/
/*
if (event.getObject() instanceof QMMStatementExecuteInfo) {
QMMStatementExecuteInfo exec = (QMMStatementExecuteInfo) event.getObject();
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/txn/TransactionMonitorToolbar.java
浏览文件 @
515c68d3
...
...
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import
org.eclipse.core.runtime.IStatus
;
import
org.eclipse.core.runtime.Status
;
import
org.eclipse.core.runtime.jobs.Job
;
import
org.eclipse.jface.resource.ColorRegistry
;
import
org.eclipse.jface.text.source.ISharedTextColors
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.*
;
...
...
@@ -55,9 +56,6 @@ public class TransactionMonitorToolbar {
private
static
final
int
MONITOR_UPDATE_DELAY
=
250
;
private
static
final
RGB
COLOR_FULL
=
QueryLogViewer
.
COLOR_LIGHT_RED
;
private
static
final
RGB
COLOR_EMPTY
=
QueryLogViewer
.
COLOR_LIGHT_GREEN
;
private
IWorkbenchWindow
workbenchWindow
;
TransactionMonitorToolbar
(
IWorkbenchWindow
workbenchWindow
)
{
...
...
@@ -81,12 +79,7 @@ public class TransactionMonitorToolbar {
final
IWorkbenchPage
activePage
=
this
.
workbenchWindow
.
getActivePage
();
if
(
activePage
!=
null
)
{
activePage
.
addPartListener
(
partListener
);
monitorPanel
.
addDisposeListener
(
new
DisposeListener
()
{
@Override
public
void
widgetDisposed
(
DisposeEvent
e
)
{
activePage
.
removePartListener
(
partListener
);
}
});
monitorPanel
.
addDisposeListener
(
e
->
activePage
.
removePartListener
(
partListener
));
}
return
monitorPanel
;
...
...
@@ -118,12 +111,7 @@ public class TransactionMonitorToolbar {
MonitorPanel
(
Composite
parent
)
{
super
(
parent
,
SWT
.
BORDER
);
setCursor
(
parent
.
getDisplay
().
getSystemCursor
(
SWT
.
CURSOR_HAND
));
addPaintListener
(
new
PaintListener
()
{
@Override
public
void
paintControl
(
PaintEvent
e
)
{
paint
(
e
);
}
});
addPaintListener
(
this
::
paint
);
setBackground
(
parent
.
getDisplay
().
getSystemColor
(
SWT
.
COLOR_WIDGET_BACKGROUND
));
setToolTipText
(
"Transactions monitor"
);
...
...
@@ -133,12 +121,9 @@ public class TransactionMonitorToolbar {
qmHandler
=
new
QMEventsHandler
(
this
);
QMUtils
.
registerHandler
(
qmHandler
);
addDisposeListener
(
new
DisposeListener
()
{
@Override
public
void
widgetDisposed
(
DisposeEvent
e
)
{
QMUtils
.
unregisterHandler
(
qmHandler
);
qmHandler
=
null
;
}
addDisposeListener
(
e
->
{
QMUtils
.
unregisterHandler
(
qmHandler
);
qmHandler
=
null
;
});
addMouseListener
(
new
MouseAdapter
()
{
...
...
@@ -167,6 +152,14 @@ public class TransactionMonitorToolbar {
private
void
paint
(
PaintEvent
e
)
{
Color
bg
;
ColorRegistry
colorRegistry
=
workbenchWindow
.
getWorkbench
().
getThemeManager
().
getCurrentTheme
().
getColorRegistry
();
Color
colorReverted
=
colorRegistry
.
get
(
QueryLogViewer
.
COLOR_REVERTED
);
Color
colorCommitted
=
colorRegistry
.
get
(
QueryLogViewer
.
COLOR_COMMITTED
);
final
RGB
COLOR_FULL
=
colorReverted
.
getRGB
();
final
RGB
COLOR_EMPTY
=
colorCommitted
.
getRGB
();
final
int
updateCount
=
txnState
==
null
?
0
:
txnState
.
getUpdateCount
();
if
(
txnState
==
null
||
!
txnState
.
isTransactionMode
())
{
...
...
@@ -216,15 +209,12 @@ public class TransactionMonitorToolbar {
monitor
.
done
();
// Update UI
DBeaverUI
.
asyncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
isDisposed
())
{
return
;
}
redraw
();
updateToolTipText
();
DBeaverUI
.
asyncExec
(()
->
{
if
(
isDisposed
())
{
return
;
}
redraw
();
updateToolTipText
();
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录