Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
9f39514b
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,发现更多精彩内容 >>
提交
9f39514b
编写于
6月 08, 2018
作者:
S
serge@jkiss.org
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Save edit value in RSV
Former-commit-id:
341955a2
上级
abddd270
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
43 addition
and
14 deletion
+43
-14
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/AbstractPresentation.java
...s/dbeaver/ui/controls/resultset/AbstractPresentation.java
+6
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/IResultSetPresentation.java
...dbeaver/ui/controls/resultset/IResultSetPresentation.java
+2
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
.../jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
+1
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
...ntrols/resultset/spreadsheet/SpreadsheetPresentation.java
+34
-14
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/AbstractPresentation.java
浏览文件 @
9f39514b
...
...
@@ -49,6 +49,7 @@ public abstract class AbstractPresentation implements IResultSetPresentation, IS
public
static
final
String
RESULTS_CONTROL_CONTEXT_ID
=
"org.jkiss.dbeaver.ui.context.resultset.focused"
;
public
static
final
StructuredSelection
EMPTY_SELECTION
=
new
StructuredSelection
();
public
static
final
String
RESULT_SET_PRESENTATION_CONTEXT_MENU
=
"org.jkiss.dbeaver.ui.controls.resultset.conext.menu"
;
public
static
final
String
DATA_VALUE_CONTROLLER
=
"org.jkiss.dbeaver.resultset.value-controller"
;
@NotNull
protected
IResultSetController
controller
;
...
...
@@ -62,6 +63,11 @@ public abstract class AbstractPresentation implements IResultSetPresentation, IS
return
controller
;
}
@Override
public
void
applyChanges
()
{
// Do nothing
}
@Override
public
void
createPresentation
(
@NotNull
final
IResultSetController
controller
,
@NotNull
Composite
parent
)
{
this
.
controller
=
controller
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/IResultSetPresentation.java
浏览文件 @
9f39514b
...
...
@@ -71,6 +71,8 @@ public interface IResultSetPresentation {
void
updateValueView
();
void
applyChanges
();
/**
* Called by controller to fill context menu.
* Note: context menu invocation must be initiated by presentation, then it should call controller's
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
浏览文件 @
9f39514b
...
...
@@ -2891,6 +2891,7 @@ public class ResultSetViewer extends Viewer
*/
private
boolean
applyChanges
(
@Nullable
final
DBRProgressMonitor
monitor
,
@Nullable
final
ResultSetPersister
.
DataUpdateListener
listener
)
{
//getActivePresentation().
try
{
final
ResultSetPersister
persister
=
createDataPersister
(
false
);
final
ResultSetPersister
.
DataUpdateListener
applyListener
=
success
->
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
浏览文件 @
9f39514b
...
...
@@ -139,6 +139,7 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
private
boolean
showCelIcons
=
true
;
private
boolean
colorizeDataTypes
=
true
;
private
boolean
rightJustifyNumbers
=
true
;
private
IValueEditor
activeInlineEditor
;
public
SpreadsheetPresentation
()
{
findReplaceTarget
=
new
SpreadsheetFindReplaceTarget
(
this
);
...
...
@@ -155,6 +156,22 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
return
dataContainer
==
null
?
null
:
dataContainer
.
getDataSource
();
}
@Override
public
void
applyChanges
()
{
if
(
activeInlineEditor
!=
null
&&
activeInlineEditor
.
getControl
()
!=
null
&&
!
activeInlineEditor
.
getControl
().
isDisposed
())
{
IValueController
valueController
=
(
IValueController
)
activeInlineEditor
.
getControl
().
getData
(
DATA_VALUE_CONTROLLER
);
if
(
valueController
!=
null
)
{
try
{
Object
value
=
activeInlineEditor
.
extractEditorValue
();
valueController
.
updateValue
(
value
,
true
);
}
catch
(
DBException
e
)
{
DBUserInterface
.
getInstance
().
showError
(
"Error extracting editor value"
,
null
,
e
);
}
}
spreadsheet
.
cancelInlineEditor
();
}
}
@Override
public
void
createPresentation
(
@NotNull
IResultSetController
controller
,
@NotNull
Composite
parent
)
{
super
.
createPresentation
(
controller
,
parent
);
...
...
@@ -820,6 +837,7 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
return
null
;
}
spreadsheet
.
cancelInlineEditor
();
activeInlineEditor
=
null
;
placeholder
=
new
Composite
(
spreadsheet
,
SWT
.
NONE
);
placeholder
.
setFont
(
spreadsheet
.
getFont
());
...
...
@@ -865,48 +883,50 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
}
*/
final
IValueEditor
editor
;
try
{
e
ditor
=
valueController
.
getValueManager
().
createEditor
(
valueController
);
activeInlineE
ditor
=
valueController
.
getValueManager
().
createEditor
(
valueController
);
}
catch
(
Exception
e
)
{
DBUserInterface
.
getInstance
().
showError
(
"Cannot edit value"
,
null
,
e
);
return
null
;
}
if
(
editor
!=
null
)
{
editor
.
createControl
();
if
(
activeInlineEditor
!=
null
)
{
activeInlineEditor
.
createControl
();
if
(
activeInlineEditor
.
getControl
()
!=
null
)
{
activeInlineEditor
.
getControl
().
setData
(
DATA_VALUE_CONTROLLER
,
valueController
);
}
}
if
(
e
ditor
instanceof
IValueEditorStandalone
)
{
valueController
.
registerEditor
((
IValueEditorStandalone
)
e
ditor
);
Control
editorControl
=
e
ditor
.
getControl
();
if
(
activeInlineE
ditor
instanceof
IValueEditorStandalone
)
{
valueController
.
registerEditor
((
IValueEditorStandalone
)
activeInlineE
ditor
);
Control
editorControl
=
activeInlineE
ditor
.
getControl
();
if
(
editorControl
!=
null
)
{
editorControl
.
addDisposeListener
(
e
->
valueController
.
unregisterEditor
((
IValueEditorStandalone
)
e
ditor
));
editorControl
.
addDisposeListener
(
e
->
valueController
.
unregisterEditor
((
IValueEditorStandalone
)
activeInlineE
ditor
));
}
// show dialog in separate job to avoid block
new
UIJob
(
"Open separate editor"
)
{
@Override
public
IStatus
runInUIThread
(
IProgressMonitor
monitor
)
{
((
IValueEditorStandalone
)
e
ditor
).
showValueEditor
();
((
IValueEditorStandalone
)
activeInlineE
ditor
).
showValueEditor
();
return
Status
.
OK_STATUS
;
}
}.
schedule
();
//((IValueEditorStandalone)editor).showValueEditor();
}
else
{
// Set editable value
if
(
e
ditor
!=
null
)
{
if
(
activeInlineE
ditor
!=
null
)
{
try
{
e
ditor
.
primeEditorValue
(
valueController
.
getValue
());
activeInlineE
ditor
.
primeEditorValue
(
valueController
.
getValue
());
}
catch
(
DBException
e
)
{
log
.
error
(
e
);
}
e
ditor
.
setDirty
(
false
);
activeInlineE
ditor
.
setDirty
(
false
);
}
}
if
(
inline
)
{
if
(
e
ditor
!=
null
)
{
if
(
activeInlineE
ditor
!=
null
)
{
spreadsheet
.
showCellEditor
(
placeholder
);
return
e
ditor
.
getControl
();
return
activeInlineE
ditor
.
getControl
();
}
else
{
// No editor was created so just drop placeholder
placeholder
.
dispose
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录