Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
556f83c7
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,发现更多精彩内容 >>
提交
556f83c7
编写于
6月 10, 2016
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#523 Filter dialog - sort attributes
上级
25b960a1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
12 deletion
+31
-12
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIIcon.java
...g.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIIcon.java
+1
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/FilterSettingsDialog.java
...s/dbeaver/ui/controls/resultset/FilterSettingsDialog.java
+30
-12
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIIcon.java
浏览文件 @
556f83c7
...
...
@@ -86,6 +86,7 @@ public class UIIcon {
public
static
final
DBIcon
SORT_DECREASE
=
new
DBIcon
(
"sort_decrease"
,
"misc/sort_decrease.png"
);
//$NON-NLS-1$ //$NON-NLS-2$
public
static
final
DBIcon
SORT_UNKNOWN
=
new
DBIcon
(
"sort_unknown"
,
"misc/sort_unknown.png"
);
//$NON-NLS-1$ //$NON-NLS-2$
public
static
final
DBIcon
FRAME_QUERY
=
new
DBIcon
(
"frame_query"
,
"misc/frame_query.png"
);
//$NON-NLS-1$ //$NON-NLS-2$
public
static
final
DBIcon
SORT
=
new
DBIcon
(
"sort"
,
"misc/sort.png"
);
//$NON-NLS-1$ //$NON-NLS-2$
public
static
final
DBIcon
FILTER
=
new
DBIcon
(
"filter"
,
"misc/filter.png"
);
//$NON-NLS-1$ //$NON-NLS-2$
public
static
final
DBIcon
FILTER_VALUE
=
new
DBIcon
(
"filter_value"
,
"misc/filter_value.png"
);
//$NON-NLS-1$ //$NON-NLS-2$
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/FilterSettingsDialog.java
浏览文件 @
556f83c7
...
...
@@ -66,6 +66,12 @@ class FilterSettingsDialog extends HelpEnabledDialog {
return
c1
.
getVisualPosition
()
-
c2
.
getVisualPosition
();
}
};
public
final
Comparator
<
DBDAttributeBinding
>
ALPHA_SORTER
=
new
Comparator
<
DBDAttributeBinding
>()
{
@Override
public
int
compare
(
DBDAttributeBinding
o1
,
DBDAttributeBinding
o2
)
{
return
o1
.
getName
().
compareTo
(
o2
.
getName
());
}
};
private
final
ResultSetViewer
resultSetViewer
;
private
final
List
<
DBDAttributeBinding
>
attributes
;
...
...
@@ -80,6 +86,7 @@ class FilterSettingsDialog extends HelpEnabledDialog {
private
ToolItem
moveUpButton
;
private
ToolItem
moveDownButton
;
private
ToolItem
moveBottomButton
;
private
Comparator
<
DBDAttributeBinding
>
activeSorter
=
POSITION_SORTER
;
public
FilterSettingsDialog
(
ResultSetViewer
resultSetViewer
)
{
...
...
@@ -120,7 +127,7 @@ class FilterSettingsDialog extends HelpEnabledDialog {
return
null
;
}
final
DBDAttributeBinding
[]
res
=
nestedBindings
.
toArray
(
new
DBDAttributeBinding
[
nestedBindings
.
size
()]);
Arrays
.
sort
(
res
,
POSITION_SORTER
);
Arrays
.
sort
(
res
,
activeSorter
);
return
res
;
}
...
...
@@ -241,11 +248,23 @@ class FilterSettingsDialog extends HelpEnabledDialog {
@Override
public
void
run
()
{
int
selectionIndex
=
getSelectionIndex
(
columnsViewer
.
getTree
());
moveColumn
(
selectionIndex
,
attributes
.
size
()
-
1
);
moveColumn
(
selectionIndex
,
getItemsCount
()
-
1
);
}
});
moveBottomButton
.
setEnabled
(
false
);
UIUtils
.
createToolBarSeparator
(
toolbar
,
SWT
.
VERTICAL
);
createToolItem
(
toolbar
,
"Sort"
,
UIIcon
.
SORT
,
new
Runnable
()
{
@Override
public
void
run
()
{
Collections
.
sort
(
attributes
,
ALPHA_SORTER
);
for
(
int
i
=
0
;
i
<
attributes
.
size
();
i
++)
{
final
DBDAttributeConstraint
constraint
=
getBindingConstraint
(
attributes
.
get
(
i
));
constraint
.
setVisualPosition
(
i
);
}
columnsViewer
.
refresh
();
}
});
UIUtils
.
createToolBarSeparator
(
toolbar
,
SWT
.
VERTICAL
);
ToolItem
showAllButton
=
createToolItem
(
toolbar
,
"Show All"
,
null
,
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
@@ -284,8 +303,8 @@ class FilterSettingsDialog extends HelpEnabledDialog {
int
selectionIndex
=
getSelectionIndex
(
columnsViewer
.
getTree
());
moveTopButton
.
setEnabled
(
selectionIndex
>
0
);
moveUpButton
.
setEnabled
(
selectionIndex
>
0
);
moveDownButton
.
setEnabled
(
selectionIndex
>=
0
&&
selectionIndex
<
attributes
.
size
()
-
1
);
moveBottomButton
.
setEnabled
(
selectionIndex
>=
0
&&
selectionIndex
<
attributes
.
size
()
-
1
);
moveDownButton
.
setEnabled
(
selectionIndex
>=
0
&&
selectionIndex
<
getItemsCount
()
-
1
);
moveBottomButton
.
setEnabled
(
selectionIndex
>=
0
&&
selectionIndex
<
getItemsCount
()
-
1
);
}
});
...
...
@@ -321,8 +340,12 @@ class FilterSettingsDialog extends HelpEnabledDialog {
return
parent
;
}
private
int
getItemsCount
()
{
return
columnsViewer
.
getTree
().
getItemCount
();
}
private
void
refreshData
()
{
Collections
.
sort
(
attributes
,
POSITION_SORTER
);
Collections
.
sort
(
attributes
,
activeSorter
);
columnsViewer
.
refresh
();
columnsViewer
.
expandAll
();
}
...
...
@@ -345,13 +368,8 @@ class FilterSettingsDialog extends HelpEnabledDialog {
refreshData
();
moveTopButton
.
setEnabled
(
newIndex
>
0
);
moveUpButton
.
setEnabled
(
newIndex
>
0
);
moveDownButton
.
setEnabled
(
newIndex
<
attributes
.
size
()
-
1
);
moveBottomButton
.
setEnabled
(
newIndex
<
attributes
.
size
()
-
1
);
//columnsViewer.sh
// DBDAttributeConstraint constraint = constraints.remove(curIndex);
// constraints.add(newIndex, constraint);
// columnsViewer.refresh();
// columnsViewer.setSelection(columnsViewer.getSelection());
moveDownButton
.
setEnabled
(
newIndex
<
getItemsCount
()
-
1
);
moveBottomButton
.
setEnabled
(
newIndex
<
getItemsCount
()
-
1
);
}
private
void
createCustomFilters
(
TabFolder
tabFolder
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录