Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
b60aea8c
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,发现更多精彩内容 >>
提交
b60aea8c
编写于
9月 23, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Value controller refactoring
上级
3cb23fac
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
48 addition
and
57 deletion
+48
-57
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/sql/SQLQueryParameterBindDialog.java
...kiss/dbeaver/runtime/sql/SQLQueryParameterBindDialog.java
+2
-5
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetValueController.java
...eaver/ui/controls/resultset/ResultSetValueController.java
+0
-9
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
...ntrols/resultset/spreadsheet/SpreadsheetPresentation.java
+2
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/ViewValuePanel.java
...ver/ui/controls/resultset/spreadsheet/ViewValuePanel.java
+0
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/IMultiController.java
....core/src/org/jkiss/dbeaver/ui/data/IMultiController.java
+38
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/IValueController.java
....core/src/org/jkiss/dbeaver/ui/data/IValueController.java
+0
-12
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java
...rc/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java
+6
-6
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
...rg/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
+0
-12
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
...rc/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
+0
-10
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/sql/SQLQueryParameterBindDialog.java
浏览文件 @
b60aea8c
...
...
@@ -45,10 +45,7 @@ import org.jkiss.dbeaver.model.struct.DBSDataType;
import
org.jkiss.dbeaver.model.struct.DBSTypedObject
;
import
org.jkiss.dbeaver.ui.DBeaverIcons
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.data.IValueController
;
import
org.jkiss.dbeaver.ui.data.IValueEditor
;
import
org.jkiss.dbeaver.ui.data.IValueEditorStandalone
;
import
org.jkiss.dbeaver.ui.data.IValueManager
;
import
org.jkiss.dbeaver.ui.data.*
;
import
org.jkiss.dbeaver.ui.data.registry.DataManagerRegistry
;
import
org.jkiss.utils.ArrayUtils
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -322,7 +319,7 @@ public class SQLQueryParameterBindDialog extends StatusDialog {
}
}
private
class
ParameterValueController
implements
IValueController
{
private
class
ParameterValueController
implements
IValueController
,
IMultiController
{
private
final
SQLQueryParameter
parameter
;
private
final
Composite
placeholder
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetValueController.java
浏览文件 @
b60aea8c
...
...
@@ -189,15 +189,6 @@ public class ResultSetValueController implements IAttributeController, IRowContr
return
null
;
}
@Override
public
void
closeInlineEditor
()
{
}
@Override
public
void
nextInlineEditor
(
boolean
next
)
{
}
@Override
public
void
showMessage
(
String
message
,
boolean
error
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
浏览文件 @
b60aea8c
...
...
@@ -90,6 +90,7 @@ import org.jkiss.dbeaver.ui.controls.lightgrid.GridPos;
import
org.jkiss.dbeaver.ui.controls.lightgrid.IGridContentProvider
;
import
org.jkiss.dbeaver.ui.controls.lightgrid.IGridLabelProvider
;
import
org.jkiss.dbeaver.ui.controls.resultset.*
;
import
org.jkiss.dbeaver.ui.data.IMultiController
;
import
org.jkiss.dbeaver.ui.data.IValueController
;
import
org.jkiss.dbeaver.ui.data.IValueEditor
;
import
org.jkiss.dbeaver.ui.data.IValueEditorStandalone
;
...
...
@@ -1441,7 +1442,7 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
/////////////////////////////
// Value controller
public
class
SpreadsheetValueController
extends
ResultSetValueController
{
public
class
SpreadsheetValueController
extends
ResultSetValueController
implements
IMultiController
{
public
SpreadsheetValueController
(
@NotNull
IResultSetController
controller
,
@NotNull
DBDAttributeBinding
binding
,
@NotNull
ResultSetRow
row
,
@NotNull
EditType
editType
,
@Nullable
Composite
inlinePlaceholder
)
{
super
(
controller
,
binding
,
row
,
editType
,
inlinePlaceholder
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/ViewValuePanel.java
浏览文件 @
b60aea8c
...
...
@@ -203,10 +203,8 @@ abstract class ViewValuePanel extends Composite {
{
try
{
Object
newValue
=
valueViewer
.
extractEditorValue
();
//previewController.closeInlineEditor();
previewController
.
updateValue
(
newValue
);
}
catch
(
DBException
e
)
{
previewController
.
closeInlineEditor
();
UIUtils
.
showErrorDialog
(
null
,
"Value save"
,
"Can't save edited value"
,
e
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/IMultiController.java
0 → 100644
浏览文件 @
b60aea8c
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package
org.jkiss.dbeaver.ui.data
;
/**
* Multi-value controller.
* Supports value editors switch.
*/
public
interface
IMultiController
{
/**
* Closes current value editor.
* This action may initiated by editor control (e.g. on Enter or Esc key)
*/
void
closeInlineEditor
();
/**
* Closes current editor and activated next cell editor
* @param next true for next and false for previous cell
*/
void
nextInlineEditor
(
boolean
next
);
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/IValueController.java
浏览文件 @
b60aea8c
...
...
@@ -115,18 +115,6 @@ public interface IValueController
@Nullable
IContributionManager
getEditBar
();
/**
* Closes current value editor.
* This action may initiated by editor control (e.g. on Enter or Esc key)
*/
void
closeInlineEditor
();
/**
* Closes current editor and activated next cell editor
* @param next true for next and false for previous cell
*/
void
nextInlineEditor
(
boolean
next
);
/**
* Show error/warning message in grid control.
* @param message error message
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java
浏览文件 @
b60aea8c
...
...
@@ -26,6 +26,7 @@ import org.eclipse.swt.widgets.Composite;
import
org.eclipse.swt.widgets.Control
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.data.IMultiController
;
import
org.jkiss.dbeaver.ui.data.IValueController
;
import
org.jkiss.dbeaver.ui.data.IValueEditor
;
...
...
@@ -82,8 +83,7 @@ public abstract class BaseValueEditor<T extends Control> implements IValueEditor
}
});
// if (!UIUtils.isInDialog(inlineControl)) { // In dialog it also should handle all standard stuff because we have params dialog
{
if
(
valueController
instanceof
IMultiController
)
{
// In dialog it also should handle all standard stuff because we have params dialog
inlineControl
.
addTraverseListener
(
new
TraverseListener
()
{
@Override
public
void
keyTraversed
(
TraverseEvent
e
)
{
...
...
@@ -92,12 +92,12 @@ public abstract class BaseValueEditor<T extends Control> implements IValueEditor
e
.
doit
=
false
;
e
.
detail
=
SWT
.
TRAVERSE_NONE
;
}
else
if
(
e
.
detail
==
SWT
.
TRAVERSE_ESCAPE
)
{
valueController
.
closeInlineEditor
();
((
IMultiController
)
valueController
)
.
closeInlineEditor
();
e
.
doit
=
false
;
e
.
detail
=
SWT
.
TRAVERSE_NONE
;
}
else
if
(
e
.
detail
==
SWT
.
TRAVERSE_TAB_NEXT
||
e
.
detail
==
SWT
.
TRAVERSE_TAB_PREVIOUS
)
{
saveValue
();
valueController
.
nextInlineEditor
(
e
.
detail
==
SWT
.
TRAVERSE_TAB_NEXT
);
((
IMultiController
)
valueController
)
.
nextInlineEditor
(
e
.
detail
==
SWT
.
TRAVERSE_TAB_NEXT
);
e
.
doit
=
false
;
e
.
detail
=
SWT
.
TRAVERSE_NONE
;
}
...
...
@@ -136,10 +136,10 @@ public abstract class BaseValueEditor<T extends Control> implements IValueEditor
{
try
{
Object
newValue
=
extractEditorValue
();
valueController
.
closeInlineEditor
();
((
IMultiController
)
valueController
)
.
closeInlineEditor
();
valueController
.
updateValue
(
newValue
);
}
catch
(
DBException
e
)
{
valueController
.
closeInlineEditor
();
((
IMultiController
)
valueController
)
.
closeInlineEditor
();
UIUtils
.
showErrorDialog
(
null
,
"Value save"
,
"Can't save edited value"
,
e
);
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
浏览文件 @
b60aea8c
...
...
@@ -348,18 +348,6 @@ public class ComplexObjectEditor extends TreeViewer {
return
null
;
}
@Override
public
void
closeInlineEditor
()
{
disposeOldEditor
();
}
@Override
public
void
nextInlineEditor
(
boolean
next
)
{
}
@Override
public
void
showMessage
(
String
message
,
boolean
error
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
浏览文件 @
b60aea8c
...
...
@@ -195,16 +195,6 @@ public abstract class ValueViewDialog extends Dialog implements IValueEditorStan
return
null
;
}
@Override
public
void
closeInlineEditor
()
{
}
@Override
public
void
nextInlineEditor
(
boolean
next
)
{
}
@Override
public
void
showMessage
(
String
message
,
boolean
error
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录