Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
b1fe5cfc
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
b1fe5cfc
编写于
6月 12, 2014
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Value handlers model
Former-commit-id:
4924870e
上级
80624751
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
250 addition
and
241 deletion
+250
-241
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBUtils.java
...iss.dbeaver.core/src/org/jkiss/dbeaver/model/DBUtils.java
+2
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/AbstractSession.java
...ore/src/org/jkiss/dbeaver/model/impl/AbstractSession.java
+2
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/data/BaseValueHandler.java
...c/org/jkiss/dbeaver/model/impl/data/BaseValueHandler.java
+232
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/data/DefaultValueHandler.java
...rg/jkiss/dbeaver/model/impl/data/DefaultValueHandler.java
+3
-31
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCAbstractValueHandler.java
...beaver/model/impl/jdbc/data/JDBCAbstractValueHandler.java
+7
-203
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
.../src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
+2
-2
plugins/org.jkiss.dbeaver.wmi/src/org/jkiss/dbeaver/ext/wmi/model/WMIValueHandlerProvider.java
.../jkiss/dbeaver/ext/wmi/model/WMIValueHandlerProvider.java
+2
-2
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBUtils.java
浏览文件 @
b1fe5cfc
...
...
@@ -32,7 +32,7 @@ import org.jkiss.dbeaver.ext.IDatabasePersistAction;
import
org.jkiss.dbeaver.model.data.*
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.impl.BaseEntityIdentifier
;
import
org.jkiss.dbeaver.model.impl.
DBC
DefaultValueHandler
;
import
org.jkiss.dbeaver.model.impl.
data.
DefaultValueHandler
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRRunnableWithResult
;
import
org.jkiss.dbeaver.model.sql.SQLDataSource
;
...
...
@@ -491,7 +491,7 @@ public final class DBUtils {
}
if
(
typeHandler
==
null
)
{
if
(
preferences
==
null
)
{
typeHandler
=
D
BCD
efaultValueHandler
.
INSTANCE
;
typeHandler
=
DefaultValueHandler
.
INSTANCE
;
}
else
{
typeHandler
=
preferences
.
getDefaultValueHandler
();
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/AbstractSession.java
浏览文件 @
b1fe5cfc
...
...
@@ -24,6 +24,7 @@ import org.jkiss.dbeaver.model.DBPTransactionIsolation;
import
org.jkiss.dbeaver.model.data.DBDDataFormatterProfile
;
import
org.jkiss.dbeaver.model.data.DBDValueHandler
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.impl.data.DefaultValueHandler
;
import
org.jkiss.dbeaver.model.qm.QMUtils
;
import
org.jkiss.dbeaver.model.runtime.DBRBlockingObject
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
...
...
@@ -102,7 +103,7 @@ public abstract class AbstractSession implements DBCSession, DBRBlockingObject {
@Override
public
DBDValueHandler
getDefaultValueHandler
()
{
return
D
BCD
efaultValueHandler
.
INSTANCE
;
return
DefaultValueHandler
.
INSTANCE
;
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/data/BaseValueHandler.java
0 → 100644
浏览文件 @
b1fe5cfc
/*
* Copyright (C) 2010-2014 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package
org.jkiss.dbeaver.model.impl.data
;
import
org.eclipse.jface.action.Action
;
import
org.eclipse.jface.action.IContributionManager
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.*
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.ToolBar
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.data.*
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.DBCLogicalOperator
;
import
org.jkiss.dbeaver.model.struct.DBSTypedObject
;
import
org.jkiss.dbeaver.ui.DBIcon
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.properties.PropertySourceAbstract
;
/**
* Base value handler
*/
public
abstract
class
BaseValueHandler
implements
DBDValueHandler
{
@Override
public
void
releaseValueObject
(
Object
value
)
{
if
(
value
instanceof
DBDValue
)
{
((
DBDValue
)
value
).
release
();
}
}
@NotNull
@Override
public
String
getValueDisplayString
(
@NotNull
DBSTypedObject
column
,
Object
value
,
@NotNull
DBDDisplayFormat
format
)
{
return
DBUtils
.
getDefaultValueDisplayString
(
value
,
format
);
}
@Override
public
void
contributeActions
(
@NotNull
IContributionManager
manager
,
@NotNull
DBDValueController
controller
)
throws
DBCException
{
}
@Override
public
void
contributeProperties
(
@NotNull
PropertySourceAbstract
propertySource
,
@NotNull
DBDValueController
controller
)
{
}
@Override
public
DBCLogicalOperator
[]
getSupportedOperators
(
@NotNull
DBDAttributeBinding
attribute
)
{
return
DBUtils
.
getDefaultOperators
(
attribute
);
}
protected
abstract
class
ValueEditor
<
T
extends
Control
>
implements
DBDValueEditor
{
protected
final
DBDValueController
valueController
;
protected
final
T
control
;
private
boolean
activated
;
protected
ValueEditor
(
final
DBDValueController
valueController
)
{
this
.
valueController
=
valueController
;
this
.
control
=
createControl
(
valueController
.
getEditPlaceholder
());
if
(
this
.
control
!=
null
)
{
initInlineControl
(
this
.
control
);
}
ToolBar
editToolBar
=
valueController
.
getEditToolBar
();
if
(
editToolBar
!=
null
)
{
if
(!
valueController
.
isReadOnly
())
{
UIUtils
.
createToolItem
(
editToolBar
,
"Save changes"
,
DBIcon
.
SAVE
.
getImage
(),
new
Action
(
"Save"
)
{
@Override
public
void
run
()
{
saveValue
();
}
});
}
}
}
@Override
public
Control
getControl
()
{
return
control
;
}
protected
abstract
T
createControl
(
Composite
editPlaceholder
);
protected
void
initInlineControl
(
final
Control
inlineControl
)
{
boolean
isInline
=
(
valueController
.
getEditType
()
==
DBDValueController
.
EditType
.
INLINE
);
// Panel controls
inlineControl
.
addFocusListener
(
new
FocusListener
()
{
@Override
public
void
focusGained
(
FocusEvent
e
)
{
if
(!
activated
)
{
UIUtils
.
enableHostEditorKeyBindings
(
valueController
.
getValueSite
(),
false
);
activated
=
true
;
}
}
@Override
public
void
focusLost
(
FocusEvent
e
)
{
if
(
activated
)
{
UIUtils
.
enableHostEditorKeyBindings
(
valueController
.
getValueSite
(),
true
);
activated
=
false
;
}
}
});
inlineControl
.
addDisposeListener
(
new
DisposeListener
()
{
@Override
public
void
widgetDisposed
(
DisposeEvent
e
)
{
if
(
activated
)
{
UIUtils
.
enableHostEditorKeyBindings
(
valueController
.
getValueSite
(),
true
);
activated
=
false
;
}
}
});
// if (!isInline) {
// inlineControl.setBackground(valueController.getEditPlaceholder().getBackground());
// }
if
(
isInline
)
{
inlineControl
.
setFont
(
valueController
.
getEditPlaceholder
().
getFont
());
// There is a bug in windows. First time date control gain focus it renders cell editor incorrectly.
// Let's focus on it in async mode
inlineControl
.
getDisplay
().
asyncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(!
inlineControl
.
isDisposed
())
{
inlineControl
.
setFocus
();
}
}
});
inlineControl
.
addTraverseListener
(
new
TraverseListener
()
{
@Override
public
void
keyTraversed
(
TraverseEvent
e
)
{
if
(
e
.
detail
==
SWT
.
TRAVERSE_RETURN
)
{
saveValue
();
e
.
doit
=
false
;
e
.
detail
=
SWT
.
TRAVERSE_NONE
;
}
else
if
(
e
.
detail
==
SWT
.
TRAVERSE_ESCAPE
)
{
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
);
e
.
doit
=
false
;
e
.
detail
=
SWT
.
TRAVERSE_NONE
;
}
}
});
inlineControl
.
addFocusListener
(
new
FocusAdapter
()
{
@Override
public
void
focusLost
(
FocusEvent
e
)
{
// Check new focus control in async mode
// (because right now focus is still on edit control)
inlineControl
.
getDisplay
().
asyncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
inlineControl
.
isDisposed
())
{
return
;
}
Control
newFocus
=
inlineControl
.
getDisplay
().
getFocusControl
();
if
(
newFocus
!=
null
)
{
for
(
Control
fc
=
newFocus
.
getParent
();
fc
!=
null
;
fc
=
fc
.
getParent
())
{
if
(
fc
==
valueController
.
getEditPlaceholder
())
{
// New focus is still a child of inline placeholder - do not close it
return
;
}
}
}
saveValue
();
}
});
}
});
}
}
private
void
saveValue
()
{
try
{
Object
newValue
=
extractEditorValue
();
valueController
.
closeInlineEditor
();
valueController
.
updateValue
(
newValue
);
}
catch
(
DBException
e
)
{
UIUtils
.
showErrorDialog
(
getControl
().
getShell
(),
"Value save"
,
"Can't save edited value"
,
e
);
}
}
}
protected
abstract
class
ValueEditorEx
<
T
extends
Control
>
extends
ValueEditor
<
T
>
implements
DBDValueEditorStandalone
{
protected
ValueEditorEx
(
final
DBDValueController
valueController
)
{
super
(
valueController
);
}
}
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/
DBC
DefaultValueHandler.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/
data/
DefaultValueHandler.java
浏览文件 @
b1fe5cfc
...
...
@@ -16,9 +16,8 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package
org.jkiss.dbeaver.model.impl
;
package
org.jkiss.dbeaver.model.impl
.data
;
import
org.eclipse.jface.action.IContributionManager
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.Text
;
...
...
@@ -30,14 +29,13 @@ import org.jkiss.dbeaver.model.data.*;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.struct.DBSTypedObject
;
import
org.jkiss.dbeaver.ui.dialogs.data.TextViewDialog
;
import
org.jkiss.dbeaver.ui.properties.PropertySourceAbstract
;
/**
* Default value handler
*/
public
class
D
BCDefaultValueHandler
implements
DBD
ValueHandler
{
public
class
D
efaultValueHandler
extends
Base
ValueHandler
{
public
static
final
D
BCDefaultValueHandler
INSTANCE
=
new
DBC
DefaultValueHandler
();
public
static
final
D
efaultValueHandler
INSTANCE
=
new
DefaultValueHandler
();
@Override
public
int
getFeatures
()
...
...
@@ -78,27 +76,6 @@ public class DBCDefaultValueHandler implements DBDValueHandler {
return
object
;
}
@Override
public
void
releaseValueObject
(
Object
value
)
{
if
(
value
instanceof
DBDValue
)
{
((
DBDValue
)
value
).
release
();
}
}
@NotNull
@Override
public
String
getValueDisplayString
(
@NotNull
DBSTypedObject
column
,
Object
value
,
@NotNull
DBDDisplayFormat
format
)
{
return
DBUtils
.
getDefaultValueDisplayString
(
value
,
format
);
}
@Override
public
void
contributeActions
(
@NotNull
IContributionManager
manager
,
@NotNull
DBDValueController
controller
)
throws
DBCException
{
}
@Override
public
void
contributeProperties
(
@NotNull
PropertySourceAbstract
propertySource
,
@NotNull
DBDValueController
controller
)
{
}
@Override
public
DBDValueEditor
createEditor
(
@NotNull
final
DBDValueController
controller
)
throws
DBException
{
switch
(
controller
.
getEditType
())
{
...
...
@@ -129,9 +106,4 @@ public class DBCDefaultValueHandler implements DBDValueHandler {
}
}
@Override
public
DBCLogicalOperator
[]
getSupportedOperators
(
@NotNull
DBDAttributeBinding
attribute
)
{
return
DBUtils
.
getDefaultOperators
(
attribute
);
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCAbstractValueHandler.java
浏览文件 @
b1fe5cfc
...
...
@@ -20,34 +20,25 @@ package org.jkiss.dbeaver.model.impl.jdbc.data;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.eclipse.jface.action.Action
;
import
org.eclipse.jface.action.IContributionManager
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.*
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.swt.widgets.ToolBar
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.data.*
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.DBCResultSet
;
import
org.jkiss.dbeaver.model.exec.DBCSession
;
import
org.jkiss.dbeaver.model.exec.DBCStatement
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCSession
;
import
org.jkiss.dbeaver.model.impl.data.BaseValueHandler
;
import
org.jkiss.dbeaver.model.struct.DBSTypedObject
;
import
org.jkiss.dbeaver.ui.DBIcon
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.properties.PropertySourceAbstract
;
import
java.sql.SQLException
;
/**
*
Standard
JDBC value handler
*
Base
JDBC value handler
*/
public
abstract
class
JDBCAbstractValueHandler
implements
DBD
ValueHandler
{
public
abstract
class
JDBCAbstractValueHandler
extends
Base
ValueHandler
{
static
final
Log
log
=
LogFactory
.
getLog
(
JDBCAbstractValueHandler
.
class
);
...
...
@@ -78,32 +69,6 @@ public abstract class JDBCAbstractValueHandler implements DBDValueHandler {
}
}
@Override
public
void
releaseValueObject
(
Object
value
)
{
if
(
value
instanceof
DBDValue
)
{
((
DBDValue
)
value
).
release
();
}
}
@NotNull
@Override
public
String
getValueDisplayString
(
@NotNull
DBSTypedObject
column
,
Object
value
,
@NotNull
DBDDisplayFormat
format
)
{
return
DBUtils
.
getDefaultValueDisplayString
(
value
,
format
);
}
@Override
public
void
contributeActions
(
@NotNull
IContributionManager
manager
,
@NotNull
DBDValueController
controller
)
throws
DBCException
{
}
@Override
public
void
contributeProperties
(
@NotNull
PropertySourceAbstract
propertySource
,
@NotNull
DBDValueController
controller
)
{
}
@Nullable
protected
abstract
Object
fetchColumnValue
(
DBCSession
session
,
JDBCResultSet
resultSet
,
DBSTypedObject
type
,
int
index
)
throws
DBCException
,
SQLException
;
...
...
@@ -116,165 +81,4 @@ public abstract class JDBCAbstractValueHandler implements DBDValueHandler {
Object
value
)
throws
DBCException
,
SQLException
;
@Override
public
DBCLogicalOperator
[]
getSupportedOperators
(
@NotNull
DBDAttributeBinding
attribute
)
{
return
DBUtils
.
getDefaultOperators
(
attribute
);
}
protected
abstract
class
ValueEditor
<
T
extends
Control
>
implements
DBDValueEditor
{
protected
final
DBDValueController
valueController
;
protected
final
T
control
;
private
boolean
activated
;
protected
ValueEditor
(
final
DBDValueController
valueController
)
{
this
.
valueController
=
valueController
;
this
.
control
=
createControl
(
valueController
.
getEditPlaceholder
());
if
(
this
.
control
!=
null
)
{
initInlineControl
(
this
.
control
);
}
ToolBar
editToolBar
=
valueController
.
getEditToolBar
();
if
(
editToolBar
!=
null
)
{
if
(!
valueController
.
isReadOnly
())
{
UIUtils
.
createToolItem
(
editToolBar
,
"Save changes"
,
DBIcon
.
SAVE
.
getImage
(),
new
Action
(
"Save"
)
{
@Override
public
void
run
()
{
saveValue
();
}
});
}
}
}
@Override
public
Control
getControl
()
{
return
control
;
}
protected
abstract
T
createControl
(
Composite
editPlaceholder
);
protected
void
initInlineControl
(
final
Control
inlineControl
)
{
boolean
isInline
=
(
valueController
.
getEditType
()
==
DBDValueController
.
EditType
.
INLINE
);
// Panel controls
inlineControl
.
addFocusListener
(
new
FocusListener
()
{
@Override
public
void
focusGained
(
FocusEvent
e
)
{
if
(!
activated
)
{
UIUtils
.
enableHostEditorKeyBindings
(
valueController
.
getValueSite
(),
false
);
activated
=
true
;
}
}
@Override
public
void
focusLost
(
FocusEvent
e
)
{
if
(
activated
)
{
UIUtils
.
enableHostEditorKeyBindings
(
valueController
.
getValueSite
(),
true
);
activated
=
false
;
}
}
});
inlineControl
.
addDisposeListener
(
new
DisposeListener
()
{
@Override
public
void
widgetDisposed
(
DisposeEvent
e
)
{
if
(
activated
)
{
UIUtils
.
enableHostEditorKeyBindings
(
valueController
.
getValueSite
(),
true
);
activated
=
false
;
}
}
});
// if (!isInline) {
// inlineControl.setBackground(valueController.getEditPlaceholder().getBackground());
// }
if
(
isInline
)
{
inlineControl
.
setFont
(
valueController
.
getEditPlaceholder
().
getFont
());
// There is a bug in windows. First time date control gain focus it renders cell editor incorrectly.
// Let's focus on it in async mode
inlineControl
.
getDisplay
().
asyncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(!
inlineControl
.
isDisposed
())
{
inlineControl
.
setFocus
();
}
}
});
inlineControl
.
addTraverseListener
(
new
TraverseListener
()
{
@Override
public
void
keyTraversed
(
TraverseEvent
e
)
{
if
(
e
.
detail
==
SWT
.
TRAVERSE_RETURN
)
{
saveValue
();
e
.
doit
=
false
;
e
.
detail
=
SWT
.
TRAVERSE_NONE
;
}
else
if
(
e
.
detail
==
SWT
.
TRAVERSE_ESCAPE
)
{
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
);
e
.
doit
=
false
;
e
.
detail
=
SWT
.
TRAVERSE_NONE
;
}
}
});
inlineControl
.
addFocusListener
(
new
FocusAdapter
()
{
@Override
public
void
focusLost
(
FocusEvent
e
)
{
// Check new focus control in async mode
// (because right now focus is still on edit control)
inlineControl
.
getDisplay
().
asyncExec
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
inlineControl
.
isDisposed
())
{
return
;
}
Control
newFocus
=
inlineControl
.
getDisplay
().
getFocusControl
();
if
(
newFocus
!=
null
)
{
for
(
Control
fc
=
newFocus
.
getParent
();
fc
!=
null
;
fc
=
fc
.
getParent
())
{
if
(
fc
==
valueController
.
getEditPlaceholder
())
{
// New focus is still a child of inline placeholder - do not close it
return
;
}
}
}
saveValue
();
}
});
}
});
}
}
private
void
saveValue
()
{
try
{
Object
newValue
=
extractEditorValue
();
valueController
.
closeInlineEditor
();
valueController
.
updateValue
(
newValue
);
}
catch
(
DBException
e
)
{
UIUtils
.
showErrorDialog
(
getControl
().
getShell
(),
"Value save"
,
"Can't save edited value"
,
e
);
}
}
}
protected
abstract
class
ValueEditorEx
<
T
extends
Control
>
extends
ValueEditor
<
T
>
implements
DBDValueEditorStandalone
{
protected
ValueEditorEx
(
final
DBDValueController
valueController
)
{
super
(
valueController
);
}
}
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
浏览文件 @
b1fe5cfc
...
...
@@ -41,7 +41,7 @@ import org.jkiss.dbeaver.model.exec.DBCException;
import
org.jkiss.dbeaver.model.exec.DBCExecutionPurpose
;
import
org.jkiss.dbeaver.model.exec.DBCSession
;
import
org.jkiss.dbeaver.model.exec.DBCTransactionManager
;
import
org.jkiss.dbeaver.model.impl.
DBC
DefaultValueHandler
;
import
org.jkiss.dbeaver.model.impl.
data.
DefaultValueHandler
;
import
org.jkiss.dbeaver.model.meta.Property
;
import
org.jkiss.dbeaver.model.net.DBWHandlerConfiguration
;
import
org.jkiss.dbeaver.model.net.DBWHandlerType
;
...
...
@@ -969,7 +969,7 @@ public class DataSourceDescriptor
@Override
public
DBDValueHandler
getDefaultValueHandler
()
{
return
D
BCD
efaultValueHandler
.
INSTANCE
;
return
DefaultValueHandler
.
INSTANCE
;
}
@Override
...
...
plugins/org.jkiss.dbeaver.wmi/src/org/jkiss/dbeaver/ext/wmi/model/WMIValueHandlerProvider.java
浏览文件 @
b1fe5cfc
...
...
@@ -22,7 +22,7 @@ import org.eclipse.swt.graphics.Image;
import
org.jkiss.dbeaver.model.data.DBDPreferences
;
import
org.jkiss.dbeaver.model.data.DBDValueHandler
;
import
org.jkiss.dbeaver.model.data.DBDValueHandlerProvider
;
import
org.jkiss.dbeaver.model.impl.
DBC
DefaultValueHandler
;
import
org.jkiss.dbeaver.model.impl.
data.
DefaultValueHandler
;
import
org.jkiss.dbeaver.model.struct.DBSTypedObject
;
/**
...
...
@@ -39,7 +39,7 @@ public class WMIValueHandlerProvider implements DBDValueHandlerProvider {
@Override
public
DBDValueHandler
getHandler
(
DBDPreferences
preferences
,
DBSTypedObject
typedObject
)
{
return
D
BCD
efaultValueHandler
.
INSTANCE
;
return
DefaultValueHandler
.
INSTANCE
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录