Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
2049e0c0
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,发现更多精彩内容 >>
提交
2049e0c0
编写于
11月 27, 2015
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#77 History deletion
Former-commit-id:
9bd5fa1b
上级
0c62cd1d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
74 addition
and
35 deletion
+74
-35
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetFilterPanel.java
...s/dbeaver/ui/controls/resultset/ResultSetFilterPanel.java
+74
-35
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetFilterPanel.java
浏览文件 @
2049e0c0
...
...
@@ -458,39 +458,6 @@ class ResultSetFilterPanel extends Composite
return
textWidget
;
}
@NotNull
private
Table
createFilterHistoryPanel
(
final
Shell
popup
)
{
final
Table
historyTable
=
new
Table
(
popup
,
SWT
.
BORDER
|
SWT
.
FULL_SELECTION
);
new
TableColumn
(
historyTable
,
SWT
.
NONE
);
if
(
filtersHistory
.
isEmpty
())
{
// nothing
}
else
{
String
curFilterValue
=
filtersText
.
getText
();
for
(
int
i
=
filtersHistory
.
size
();
i
>
0
;
i
--)
{
String
hi
=
filtersHistory
.
get
(
i
-
1
);
if
(!
CommonUtils
.
equalObjects
(
hi
,
curFilterValue
))
{
new
TableItem
(
historyTable
,
SWT
.
NONE
).
setText
(
hi
);
}
}
}
historyTable
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
final
int
selectionIndex
=
historyTable
.
getSelectionIndex
();
if
(
selectionIndex
>=
0
)
{
final
String
newFilter
=
historyTable
.
getItem
(
selectionIndex
).
getText
();
popup
.
dispose
();
setFilterValue
(
newFilter
);
setCustomDataFilter
();
}
}
});
return
historyTable
;
}
private
class
FilterPanel
extends
Canvas
{
protected
boolean
hover
=
false
;
public
FilterPanel
(
Composite
parent
,
int
style
)
{
...
...
@@ -527,6 +494,7 @@ class ResultSetFilterPanel extends Composite
public
static
final
int
MIN_INFO_PANEL_WIDTH
=
300
;
public
static
final
int
MIN_INFO_PANEL_HEIGHT
=
100
;
public
static
final
int
MAX_INFO_PANEL_HEIGHT
=
400
;
private
Shell
popup
;
public
ActiveObjectPanel
(
Composite
addressBar
)
{
super
(
addressBar
,
SWT
.
NONE
);
...
...
@@ -541,7 +509,10 @@ class ResultSetFilterPanel extends Composite
}
private
void
showObjectInfoPopup
(
MouseEvent
e
)
{
final
Shell
popup
=
new
Shell
(
getShell
(),
SWT
.
NO_TRIM
|
SWT
.
ON_TOP
|
SWT
.
RESIZE
);
if
(
popup
!=
null
)
{
popup
.
dispose
();
}
popup
=
new
Shell
(
getShell
(),
SWT
.
NO_TRIM
|
SWT
.
ON_TOP
|
SWT
.
RESIZE
);
popup
.
setLayout
(
new
FillLayout
());
Control
editControl
;
try
{
...
...
@@ -620,6 +591,8 @@ class ResultSetFilterPanel extends Composite
private
class
HistoryPanel
extends
FilterPanel
{
private
final
Image
dropImageE
,
dropImageD
;
private
TableItem
hoverItem
;
private
Shell
popup
;
public
HistoryPanel
(
Composite
addressBar
)
{
super
(
addressBar
,
SWT
.
NONE
);
...
...
@@ -656,7 +629,10 @@ class ResultSetFilterPanel extends Composite
}
private
void
showFilterHistoryPopup
(
MouseEvent
e
)
{
final
Shell
popup
=
new
Shell
(
getShell
(),
SWT
.
NO_TRIM
|
SWT
.
ON_TOP
|
SWT
.
RESIZE
);
if
(
popup
!=
null
)
{
popup
.
dispose
();
}
popup
=
new
Shell
(
getShell
(),
SWT
.
NO_TRIM
|
SWT
.
ON_TOP
|
SWT
.
RESIZE
);
popup
.
setLayout
(
new
FillLayout
());
Table
editControl
=
createFilterHistoryPanel
(
popup
);
...
...
@@ -682,6 +658,69 @@ class ResultSetFilterPanel extends Composite
}
});
}
@NotNull
private
Table
createFilterHistoryPanel
(
final
Shell
popup
)
{
final
Table
historyTable
=
new
Table
(
popup
,
SWT
.
BORDER
|
SWT
.
FULL_SELECTION
|
SWT
.
SINGLE
);
new
TableColumn
(
historyTable
,
SWT
.
NONE
);
if
(
filtersHistory
.
isEmpty
())
{
// nothing
}
else
{
String
curFilterValue
=
filtersText
.
getText
();
for
(
int
i
=
filtersHistory
.
size
();
i
>
0
;
i
--)
{
String
hi
=
filtersHistory
.
get
(
i
-
1
);
if
(!
CommonUtils
.
equalObjects
(
hi
,
curFilterValue
))
{
new
TableItem
(
historyTable
,
SWT
.
NONE
).
setText
(
hi
);
}
}
historyTable
.
deselectAll
();
}
historyTable
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
final
int
selectionIndex
=
historyTable
.
getSelectionIndex
();
if
(
selectionIndex
>=
0
)
{
final
String
newFilter
=
historyTable
.
getItem
(
selectionIndex
).
getText
();
popup
.
dispose
();
setFilterValue
(
newFilter
);
setCustomDataFilter
();
}
}
});
historyTable
.
addMouseTrackListener
(
new
MouseTrackAdapter
()
{
@Override
public
void
mouseHover
(
MouseEvent
e
)
{
hoverItem
=
historyTable
.
getItem
(
new
Point
(
e
.
x
,
e
.
y
));
}
@Override
public
void
mouseExit
(
MouseEvent
e
)
{
hoverItem
=
null
;
}
});
historyTable
.
addKeyListener
(
new
KeyAdapter
()
{
@Override
public
void
keyPressed
(
KeyEvent
e
)
{
if
(
e
.
keyCode
==
SWT
.
DEL
)
{
if
(
hoverItem
!=
null
)
{
final
String
filterValue
=
hoverItem
.
getText
();
try
{
viewer
.
getFilterManager
().
deleteQueryFilterValue
(
getActiveSourceQuery
(),
filterValue
);
}
catch
(
DBException
e1
)
{
log
.
warn
(
"Error deleting filter value ["
+
filterValue
+
"]"
,
e1
);
}
filtersHistory
.
remove
(
filterValue
);
hoverItem
.
dispose
();
}
}
}
});
return
historyTable
;
}
}
private
class
RefreshPanel
extends
FilterPanel
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录