Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
cfe5eb15
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,发现更多精彩内容 >>
未验证
提交
cfe5eb15
编写于
10月 21, 2021
作者:
S
ShadelessFox
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#14088 `Set to NULL` action for complex object editor
上级
c9ffcaaf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
0 deletion
+33
-0
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/data/dialogs/ComplexObjectEditor.java
...rg/jkiss/dbeaver/ui/data/dialogs/ComplexObjectEditor.java
+30
-0
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/data/internal/DataEditorsMessages.java
...dbeaver/ui/editors/data/internal/DataEditorsMessages.java
+1
-0
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/data/internal/DataEditorsResources.properties
.../ui/editors/data/internal/DataEditorsResources.properties
+1
-0
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/data/internal/DataEditorsResources_ru.properties
.../editors/data/internal/DataEditorsResources_ru.properties
+1
-0
未找到文件。
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/data/dialogs/ComplexObjectEditor.java
浏览文件 @
cfe5eb15
...
...
@@ -62,6 +62,7 @@ import org.jkiss.dbeaver.ui.UIUtils;
import
org.jkiss.dbeaver.ui.controls.resultset.ResultSetPreferences
;
import
org.jkiss.dbeaver.ui.controls.resultset.ThemeConstants
;
import
org.jkiss.dbeaver.ui.data.*
;
import
org.jkiss.dbeaver.ui.data.managers.BaseValueManager
;
import
org.jkiss.dbeaver.ui.data.managers.DefaultValueManager
;
import
org.jkiss.dbeaver.ui.data.registry.ValueManagerRegistry
;
import
org.jkiss.dbeaver.ui.editors.data.internal.DataEditorsMessages
;
...
...
@@ -162,6 +163,7 @@ public class ComplexObjectEditor extends TreeViewer {
private
CopyAction
copyNameAction
;
private
CopyAction
copyValueAction
;
private
SetToNullAction
setToNullAction
;
private
Action
addElementAction
;
private
Action
removeElementAction
;
private
Action
moveElementUpAction
;
...
...
@@ -260,6 +262,7 @@ public class ComplexObjectEditor extends TreeViewer {
this
.
copyNameAction
=
new
CopyAction
(
true
);
this
.
copyValueAction
=
new
CopyAction
(
false
);
this
.
setToNullAction
=
new
SetToNullAction
();
this
.
addElementAction
=
new
AddElementAction
();
this
.
removeElementAction
=
new
RemoveElementAction
();
this
.
moveElementUpAction
=
new
MoveElementAction
(
SWT
.
UP
);
...
...
@@ -306,6 +309,7 @@ public class ComplexObjectEditor extends TreeViewer {
if
(!
getSelection
().
isEmpty
())
{
manager
.
add
(
copyNameAction
);
manager
.
add
(
copyValueAction
);
manager
.
add
(
setToNullAction
);
manager
.
add
(
new
Separator
());
}
try
{
...
...
@@ -822,6 +826,32 @@ public class ComplexObjectEditor extends TreeViewer {
}
}
private
class
SetToNullAction
extends
Action
{
public
SetToNullAction
()
{
super
(
DataEditorsMessages
.
complex_object_editor_dialog_menu_set_element_to_null
);
}
@Override
public
void
run
()
{
final
ITreeSelection
selection
=
getStructuredSelection
();
if
(
selection
.
isEmpty
())
{
return
;
}
try
{
final
IValueController
valueController
=
new
ComplexValueController
(
(
ComplexElement
)
selection
.
getFirstElement
(),
IValueController
.
EditType
.
NONE
);
valueController
.
updateValue
(
BaseValueManager
.
makeNullValue
(
valueController
),
true
);
}
catch
(
DBCException
e
)
{
log
.
error
(
"Error setting value attribute to NULL"
,
e
);
}
}
}
private
class
AddElementAction
extends
Action
{
AddElementAction
()
{
super
(
DataEditorsMessages
.
complex_object_editor_dialog_menu_add_element
,
DBeaverIcons
.
getImageDescriptor
(
UIIcon
.
ROW_ADD
));
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/data/internal/DataEditorsMessages.java
浏览文件 @
cfe5eb15
...
...
@@ -106,6 +106,7 @@ public class DataEditorsMessages extends NLS {
public
static
String
complex_object_editor_dialog_menu_copy_element
;
public
static
String
complex_object_editor_dialog_menu_add_element
;
public
static
String
complex_object_editor_dialog_menu_set_element_to_null
;
public
static
String
complex_object_editor_dialog_menu_remove_element
;
public
static
String
complex_object_editor_dialog_menu_move_up_element
;
public
static
String
complex_object_editor_dialog_menu_move_down_element
;
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/data/internal/DataEditorsResources.properties
浏览文件 @
cfe5eb15
...
...
@@ -83,6 +83,7 @@ virtual_structure_editor_dialog_button_refresh = Refresh
complex_object_editor_dialog_menu_copy_element
=
Copy {0}
complex_object_editor_dialog_menu_add_element
=
Add element
complex_object_editor_dialog_menu_set_element_to_null
=
Set to NULL
complex_object_editor_dialog_menu_remove_element
=
Remove element
complex_object_editor_dialog_menu_move_up_element
=
Move element up
complex_object_editor_dialog_menu_move_down_element
=
Move element down
\ No newline at end of file
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/editors/data/internal/DataEditorsResources_ru.properties
浏览文件 @
cfe5eb15
...
...
@@ -78,6 +78,7 @@ virtual_structure_editor_dialog_button_refresh = \u041E\u0431\u043D\u043E\u0432\
complex_object_editor_dialog_menu_copy_element
=
\u0421\u
043A
\u
043E
\u
043F
\u0438\u0440\u
043E
\u0432\u0430\u0442\u
044C {0}
complex_object_editor_dialog_menu_add_element
=
\u0414\u
043E
\u0431\u0430\u0432\u0438\u0442\u
044C
\u
044D
\u
043B
\u0435\u
043C
\u0435\u
043D
\u0442
complex_object_editor_dialog_menu_set_element_to_null
=
\u0423\u0441\u0442\u0430\u
043D
\u
043E
\u0432\u0438\u0442\u
044C
\u0432
NULL
complex_object_editor_dialog_menu_remove_element
=
\u0423\u0434\u0430\u
043B
\u0438\u0442\u
044C
\u
044D
\u
043B
\u0435\u
043C
\u0435\u
043D
\u0442
complex_object_editor_dialog_menu_move_up_element
=
\u
041F
\u0435\u0440\u0435\u0434\u0432\u0438\u
043D
\u0443\u0442\u
044C
\u
044D
\u
043B
\u0435\u
043C
\u0435\u
043D
\u0442
\u0432\u0432\u0435\u0440\u0445
complex_object_editor_dialog_menu_move_down_element
=
\u
041F
\u0435\u0440\u0435\u0434\u0432\u0438\u
043D
\u0443\u0442\u
044C
\u
044D
\u
043B
\u0435\u
043C
\u0435\u
043D
\u0442
\u0432\u
043D
\u0438\u0437
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录