Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
0f8c3782
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,发现更多精彩内容 >>
提交
0f8c3782
编写于
4月 06, 2021
作者:
N
Nikita Akilov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#10370 add search in comments option to ctrl + shift + d dialog
上级
ba300a3c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
81 addition
and
42 deletion
+81
-42
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/internal/UINavigatorMessages.java
...rc/org/jkiss/dbeaver/ui/internal/UINavigatorMessages.java
+1
-0
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/internal/UINavigatorMessages.properties
.../jkiss/dbeaver/ui/internal/UINavigatorMessages.properties
+1
-0
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/internal/UINavigatorMessages_ru.properties
...iss/dbeaver/ui/internal/UINavigatorMessages_ru.properties
+1
-0
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/dialogs/GotoObjectDialog.java
.../jkiss/dbeaver/ui/navigator/dialogs/GotoObjectDialog.java
+78
-42
未找到文件。
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/internal/UINavigatorMessages.java
浏览文件 @
0f8c3782
...
...
@@ -229,6 +229,7 @@ public class UINavigatorMessages extends NLS {
public
static
String
question_no_sql_available
;
public
static
String
error_sql_generation_title
;
public
static
String
error_sql_generation_message
;
public
static
String
dialog_search_objects_search_in_comments
;
static
{
// initialize resource bundle
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/internal/UINavigatorMessages.properties
浏览文件 @
0f8c3782
...
...
@@ -205,3 +205,4 @@ error_deleting_resource_message = Error deleting''{0}''
question_no_sql_available
=
No SQL script available.
\n
Are you sure you want to proceed?
error_sql_generation_title
=
Script generation error
error_sql_generation_message
=
Error generating alter script
dialog_search_objects_search_in_comments
=
Search in comments
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/internal/UINavigatorMessages_ru.properties
浏览文件 @
0f8c3782
...
...
@@ -156,3 +156,4 @@ confirm_deleting_dependent_objects = \u0414\u0440\u0443\u0433\u0438\u0435 \u043E
confirm_deleting_dependent_one_object
=
\u0414\u0440\u0443\u0433\u
043E
\u0439
\u
043E
\u0431\u
044A
\u0435\u
043A
\u0442
\u0437\u0430\u0432\u0438\u0441\u0438\u0442
\u
043E
\u0442
\u
044D
\u0442\u
043E
\u0433\u
043E
\u
043E
\u0431\u
044A
\u0435\u
043A
\u0442\u0430
\u0438
\u0434\u
043E
\u
043B
\u0436\u0435\u
043D
\u0431\u
044B
\u0442\u
044C
\u0443\u0434\u0430\u
043B
\u0451\u
043D.
\n\u0412\u
044B
\u0443\u0432\u0435\u0440\u0435\u
043D
\u
044B,
\u0447\u0442\u
043E
\u0445\u
043E
\u0442\u0438\u0442\u0435
\u0443\u0434\u0430\u
043B
\u0438\u0442\u
044C {0} {1}?
search_dependencies_error_title
=
\u
041E
\u0448\u0438\u0431\u
043A
\u0430
\u
043F
\u
043E
\u0438\u0441\u
043A
\u0430
\u0437\u0430\u0432\u0438\u0441\u0438\u
043C
\u
043E
\u0441\u0442\u0435\u0439
search_dependencies_error_message
=
\u
041E
\u0448\u0438\u0431\u
043A
\u0430
\u0432\u
043E
\u0437\u
043D
\u0438\u
043A
\u
043B
\u0430
\u
043F
\u0440\u0438
\u
043F
\u
043E
\u0438\u0441\u
043A
\u0435
\u0437\u0430\u0432\u0438\u0441\u0438\u
043C
\u
043E
\u0441\u0442\u0435\u0439
\u0434\u
043B
\u
044F
\u
044D
\u0442\u
043E
\u0433\u
043E
\u
043E
\u0431\u
044A
\u0435\u
043A
\u0442\u0430
.
dialog_search_objects_search_in_comments
=
\u0418\u0441\u
043A
\u0430\u0442\u
044C
\u0432
\u
043A
\u
043E
\u
043C
\u
043C
\u0435\u
043D
\u0442\u0430\u0440\u0438\u
044F
\u0445
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/dialogs/GotoObjectDialog.java
浏览文件 @
0f8c3782
...
...
@@ -61,17 +61,20 @@ import java.util.regex.Pattern;
* GotoObjectDialog
*/
public
class
GotoObjectDialog
extends
FilteredItemsSelectionDialog
{
private
static
final
String
DIALOG_ID
=
"GotoObjectDialog"
;
private
static
final
String
DO_NOT_SEARCH_IN_COMMENTS
=
"SearchInComments"
;
private
static
final
boolean
SHOW_OBJECT_TYPES
=
true
;
private
static
final
int
MAX_RESULT_COUNT
=
1000
;
private
final
DBCExecutionContext
context
;
private
DBSObject
container
;
private
Map
<
String
,
Boolean
>
enabledTypes
=
new
HashMap
<>();
private
final
DBSObject
container
;
private
final
Map
<
String
,
Boolean
>
enabledTypes
=
new
HashMap
<>();
private
boolean
hasMoreResults
;
//This variable is "reverted" because we want to store it in preferences and be enabled by default.
private
boolean
doNotSearchInComments
;
public
GotoObjectDialog
(
Shell
shell
,
DBCExecutionContext
context
,
DBSObject
container
)
{
super
(
shell
,
true
);
this
.
context
=
context
;
...
...
@@ -84,15 +87,39 @@ public class GotoObjectDialog extends FilteredItemsSelectionDialog {
@Override
protected
Control
createExtendedContentArea
(
Composite
parent
)
{
Composite
composite
=
UIUtils
.
createComposite
(
parent
,
1
);
composite
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
createObjectTypesGroup
(
composite
);
Button
searchInCommentsCheckbox
=
UIUtils
.
createCheckbox
(
composite
,
UINavigatorMessages
.
dialog_search_objects_search_in_comments
,
!
doNotSearchInComments
);
GridData
gd
=
new
GridData
();
gd
.
horizontalIndent
=
6
;
searchInCommentsCheckbox
.
setLayoutData
(
gd
);
searchInCommentsCheckbox
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
doNotSearchInComments
=
!
searchInCommentsCheckbox
.
getSelection
();
}
});
return
composite
;
}
private
void
createObjectTypesGroup
(
Composite
parent
)
{
if
(!
SHOW_OBJECT_TYPES
)
{
return
null
;
return
;
}
IDialogSettings
driverSettings
=
DialogSettings
.
getOrCreateSection
(
getDialogSettings
(),
context
.
getDataSource
().
getContainer
().
getDriver
().
getId
());
DBSStructureAssistant
structureAssistant
=
DBUtils
.
getAdapter
(
DBSStructureAssistant
.
class
,
context
.
getDataSource
());
DBSStructureAssistant
<?>
structureAssistant
=
DBUtils
.
getAdapter
(
DBSStructureAssistant
.
class
,
context
.
getDataSource
());
if
(
structureAssistant
==
null
)
{
return
null
;
return
;
}
List
<
DBSObjectType
>
typesToSearch
=
new
ArrayList
<>();
...
...
@@ -104,46 +131,42 @@ public class GotoObjectDialog extends FilteredItemsSelectionDialog {
}
typesToSearch
.
add
(
type
);
}
if
(!
CommonUtils
.
isEmpty
(
typesToSearch
))
{
Group
cbGroup
=
new
Group
(
parent
,
SWT
.
NONE
);
cbGroup
.
setText
(
"Objects:"
);
RowLayout
rowLayout
=
new
RowLayout
(
SWT
.
HORIZONTAL
);
rowLayout
.
wrap
=
true
;
cbGroup
.
setLayout
(
rowLayout
);
cbGroup
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
for
(
DBSObjectType
type
:
typesToSearch
)
{
if
(!
isValidObjectType
(
type
))
{
continue
;
}
if
(
CommonUtils
.
isEmpty
(
typesToSearch
))
{
return
;
}
Group
cbGroup
=
new
Group
(
parent
,
SWT
.
NONE
);
cbGroup
.
setText
(
"Objects:"
);
RowLayout
rowLayout
=
new
RowLayout
(
SWT
.
HORIZONTAL
);
rowLayout
.
wrap
=
true
;
cbGroup
.
setLayout
(
rowLayout
);
cbGroup
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
for
(
DBSObjectType
type
:
typesToSearch
)
{
if
(!
isValidObjectType
(
type
))
{
continue
;
}
Button
cb
=
new
Button
(
cbGroup
,
SWT
.
CHECK
);
cb
.
setData
(
type
);
String
typeName
=
CommonUtils
.
notEmpty
(
type
.
getTypeName
());
cb
.
setText
(
typeName
);
Button
cb
=
new
Button
(
cbGroup
,
SWT
.
CHECK
);
cb
.
setData
(
type
);
String
typeName
=
CommonUtils
.
notEmpty
(
type
.
getTypeName
());
cb
.
setText
(
typeName
);
boolean
enabled
;
if
(
driverSettings
.
get
(
typeName
)
!=
null
)
{
enabled
=
driverSettings
.
getBoolean
(
typeName
);
}
else
{
enabled
=
true
;
}
cb
.
setSelection
(
enabled
);
enabledTypes
.
put
(
typeName
,
enabled
);
cb
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
enabledTypes
.
put
(
typeName
,
cb
.
getSelection
());
driverSettings
.
put
(
typeName
,
cb
.
getSelection
());
applyFilter
();
//scheduleRefresh();
}
});
boolean
enabled
;
if
(
driverSettings
.
get
(
typeName
)
!=
null
)
{
enabled
=
driverSettings
.
getBoolean
(
typeName
);
}
else
{
enabled
=
true
;
}
return
cbGroup
;
cb
.
setSelection
(
enabled
);
enabledTypes
.
put
(
typeName
,
enabled
);
cb
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
enabledTypes
.
put
(
typeName
,
cb
.
getSelection
());
driverSettings
.
put
(
typeName
,
cb
.
getSelection
());
applyFilter
();
}
});
}
return
null
;
}
@Override
...
...
@@ -151,6 +174,18 @@ public class GotoObjectDialog extends FilteredItemsSelectionDialog {
return
UIUtils
.
getDialogSettings
(
DIALOG_ID
);
}
@Override
protected
void
restoreDialog
(
IDialogSettings
settings
)
{
super
.
restoreDialog
(
settings
);
doNotSearchInComments
=
settings
.
getBoolean
(
DO_NOT_SEARCH_IN_COMMENTS
);
}
@Override
protected
void
storeDialog
(
IDialogSettings
settings
)
{
super
.
storeDialog
(
settings
);
settings
.
put
(
DO_NOT_SEARCH_IN_COMMENTS
,
doNotSearchInComments
);
}
@Override
protected
IStatus
validateItem
(
Object
item
)
{
return
Status
.
OK_STATUS
;
...
...
@@ -372,6 +407,7 @@ public class GotoObjectDialog extends FilteredItemsSelectionDialog {
params
.
setParentObject
(
container
);
params
.
setGlobalSearch
(
true
);
params
.
setMaxResults
(
MAX_RESULT_COUNT
);
params
.
setSearchInComments
(!
doNotSearchInComments
);
result
=
structureAssistant
.
findObjectsByMask
(
monitor
,
executionContext
,
params
);
hasMoreResults
=
result
.
size
()
>=
MAX_RESULT_COUNT
;
}
catch
(
Exception
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录