Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
e28e93df
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,发现更多精彩内容 >>
提交
e28e93df
编写于
9月 23, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Value controller refactoring
Former-commit-id:
3cb23fac
上级
09ca80d6
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
23 addition
and
65 deletion
+23
-65
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/sql/SQLQueryParameterBindDialog.java
...kiss/dbeaver/runtime/sql/SQLQueryParameterBindDialog.java
+0
-5
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetValueController.java
...eaver/ui/controls/resultset/ResultSetValueController.java
+3
-6
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
...ntrols/resultset/spreadsheet/SpreadsheetPresentation.java
+13
-8
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/IValueController.java
....core/src/org/jkiss/dbeaver/ui/data/IValueController.java
+0
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java
...rc/org/jkiss/dbeaver/ui/data/editors/BaseValueEditor.java
+3
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
...rg/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
+0
-6
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
...rc/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
+2
-13
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
...c/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
+2
-22
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/sql/SQLQueryParameterBindDialog.java
浏览文件 @
e28e93df
...
...
@@ -463,11 +463,6 @@ public class SQLQueryParameterBindDialog extends StatusDialog {
{
}
@Override
public
void
unregisterEditor
(
IValueEditorStandalone
editor
)
{
}
@Override
public
void
showMessage
(
String
message
,
boolean
error
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetValueController.java
浏览文件 @
e28e93df
...
...
@@ -23,13 +23,14 @@ import org.eclipse.ui.IWorkbenchPartSite;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.data.*
;
import
org.jkiss.dbeaver.model.data.DBDAttributeBinding
;
import
org.jkiss.dbeaver.model.data.DBDRowIdentifier
;
import
org.jkiss.dbeaver.model.data.DBDValueHandler
;
import
org.jkiss.dbeaver.model.exec.DBCAttributeMetaData
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.struct.DBSTypedObject
;
import
org.jkiss.dbeaver.ui.data.IAttributeController
;
import
org.jkiss.dbeaver.ui.data.IRowController
;
import
org.jkiss.dbeaver.ui.data.IValueEditorStandalone
;
import
org.jkiss.dbeaver.ui.data.IValueManager
;
import
org.jkiss.dbeaver.ui.data.registry.DataManagerRegistry
;
...
...
@@ -197,10 +198,6 @@ public class ResultSetValueController implements IAttributeController, IRowContr
public
void
nextInlineEditor
(
boolean
next
)
{
}
@Override
public
void
unregisterEditor
(
IValueEditorStandalone
editor
)
{
}
@Override
public
void
showMessage
(
String
message
,
boolean
error
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
浏览文件 @
e28e93df
...
...
@@ -666,10 +666,9 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
private
void
closeEditors
()
{
List
<
IValueEditorStandalone
>
editors
=
new
ArrayList
<
IValueEditorStandalone
>(
openEditors
.
values
());
for
(
IValueEditorStandalone
editor
:
editors
)
{
editor
.
closeValueEditor
();
}
if
(!
openEditors
.
isEmpty
())
{
log
.
warn
(
"Some value editors are still registered at result set: "
+
openEditors
.
size
());
if
(
editor
.
getControl
()
!=
null
&&
!
editor
.
getControl
().
isDisposed
())
{
editor
.
closeValueEditor
();
}
}
openEditors
.
clear
();
}
...
...
@@ -686,10 +685,17 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
}
if
(!
inline
)
{
for
(
SpreadsheetValueController
valueController
:
openEditors
.
keySet
())
{
for
(
Iterator
<
SpreadsheetValueController
>
iterator
=
openEditors
.
keySet
().
iterator
();
iterator
.
hasNext
();
)
{
SpreadsheetValueController
valueController
=
iterator
.
next
();
if
(
attr
==
valueController
.
getBinding
()
&&
row
==
valueController
.
getCurRow
())
{
openEditors
.
get
(
valueController
).
showValueEditor
();
return
null
;
IValueEditorStandalone
editor
=
openEditors
.
get
(
valueController
);
if
(
editor
.
getControl
()
!=
null
&&
!
editor
.
getControl
().
isDisposed
())
{
editor
.
showValueEditor
();
return
null
;
}
else
{
// Remove disposed editor from the list
iterator
.
remove
();
}
}
}
}
...
...
@@ -1483,7 +1489,6 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
openEditors
.
put
(
this
,
editor
);
}
@Override
public
void
unregisterEditor
(
IValueEditorStandalone
editor
)
{
openEditors
.
remove
(
this
);
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/data/IValueController.java
浏览文件 @
e28e93df
...
...
@@ -127,8 +127,6 @@ public interface IValueController
*/
void
nextInlineEditor
(
boolean
next
);
void
unregisterEditor
(
IValueEditorStandalone
editor
);
/**
* 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
浏览文件 @
e28e93df
...
...
@@ -75,15 +75,15 @@ public abstract class BaseValueEditor<T extends Control> implements IValueEditor
// Let's focus on it in async mode
inlineControl
.
getDisplay
().
asyncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
public
void
run
()
{
if
(!
inlineControl
.
isDisposed
())
{
inlineControl
.
setFocus
();
}
}
});
if
(!
UIUtils
.
isInDialog
(
inlineControl
))
{
// if (!UIUtils.isInDialog(inlineControl)) { // In dialog it also should handle all standard stuff because we have params dialog
{
inlineControl
.
addTraverseListener
(
new
TraverseListener
()
{
@Override
public
void
keyTraversed
(
TraverseEvent
e
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ComplexObjectEditor.java
浏览文件 @
e28e93df
...
...
@@ -360,12 +360,6 @@ public class ComplexObjectEditor extends TreeViewer {
}
@Override
public
void
unregisterEditor
(
IValueEditorStandalone
editor
)
{
}
@Override
public
void
showMessage
(
String
message
,
boolean
error
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
浏览文件 @
e28e93df
...
...
@@ -205,11 +205,6 @@ public abstract class ValueViewDialog extends Dialog implements IValueEditorStan
{
}
@Override
public
void
unregisterEditor
(
IValueEditorStandalone
editor
)
{
}
@Override
public
void
showMessage
(
String
message
,
boolean
error
)
{
...
...
@@ -236,10 +231,7 @@ public abstract class ValueViewDialog extends Dialog implements IValueEditorStan
@Override
public
void
closeValueEditor
()
{
if
(
this
.
valueController
!=
null
)
{
this
.
valueController
.
unregisterEditor
(
this
);
this
.
valueController
=
null
;
}
this
.
valueController
=
null
;
this
.
setReturnCode
(
CANCEL
);
this
.
close
();
}
...
...
@@ -354,10 +346,7 @@ public abstract class ValueViewDialog extends Dialog implements IValueEditorStan
return
result
;
}
finally
{
dialogCount
--;
if
(
this
.
valueController
!=
null
)
{
this
.
valueController
.
unregisterEditor
(
this
);
this
.
valueController
=
null
;
}
this
.
valueController
=
null
;
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
浏览文件 @
e28e93df
...
...
@@ -134,8 +134,6 @@ public class ContentEditor extends MultiPageAbstractEditor implements IValueEdit
}
private
boolean
valueEditorRegistered
=
false
;
private
List
<
ContentPartInfo
>
contentParts
=
new
ArrayList
<
ContentPartInfo
>();
private
ColumnInfoPanel
infoPanel
;
private
boolean
dirty
;
...
...
@@ -232,8 +230,6 @@ public class ContentEditor extends MultiPageAbstractEditor implements IValueEdit
super
.
init
(
site
,
input
);
setPartName
(
input
.
getName
());
valueEditorRegistered
=
true
;
DBDContent
content
=
getContent
();
if
(
content
==
null
)
{
return
;
...
...
@@ -257,13 +253,6 @@ public class ContentEditor extends MultiPageAbstractEditor implements IValueEdit
this
.
partsLoaded
=
true
;
ResourcesPlugin
.
getWorkspace
().
removeResourceChangeListener
(
this
);
if
(
valueEditorRegistered
)
{
IValueController
valueController
=
getValueController
();
if
(
valueController
!=
null
)
{
valueController
.
unregisterEditor
(
this
);
}
valueEditorRegistered
=
false
;
}
if
(
getEditorInput
()
!=
null
)
{
// Release CONTENT input resources
try
{
...
...
@@ -453,7 +442,8 @@ public class ContentEditor extends MultiPageAbstractEditor implements IValueEdit
@Override
public
Control
getControl
()
{
return
getControl
(
getActivePage
());
int
activePage
=
getActivePage
();
return
activePage
<
0
?
null
:
getControl
(
activePage
);
}
@Override
...
...
@@ -501,16 +491,6 @@ public class ContentEditor extends MultiPageAbstractEditor implements IValueEdit
IWorkbenchPage
workbenchPage
=
this
.
getEditorSite
().
getWorkbenchWindow
().
getActivePage
();
if
(
workbenchPage
!=
null
)
{
workbenchPage
.
closeEditor
(
this
,
false
);
}
else
{
// Special case - occurred when entire workbench is closed
// We need to unregister editor and release all resource here
if
(
valueEditorRegistered
)
{
IValueController
valueController
=
getValueController
();
if
(
valueController
!=
null
)
{
valueController
.
unregisterEditor
(
this
);
}
valueEditorRegistered
=
false
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录