Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
a1ba0624
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,发现更多精彩内容 >>
提交
a1ba0624
编写于
1月 25, 2013
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use locale specific numbers formatting
Refactor dbc impl package Former-commit-id:
09e1337a
上级
1faddb33
变更
41
隐藏空白更改
内联
并排
Showing
41 changed file
with
414 addition
and
255 deletion
+414
-255
modules/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
modules/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
+13
-4
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/SQLUtils.java
...ss.dbeaver.core/src/org/jkiss/dbeaver/model/SQLUtils.java
+11
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/data/DBDValueEditor.java
...core/src/org/jkiss/dbeaver/model/data/DBDValueEditor.java
+3
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/exec/DBCDataRequest.java
...core/src/org/jkiss/dbeaver/model/exec/DBCDataRequest.java
+30
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/data/NumberDataFormatter.java
...rg/jkiss/dbeaver/model/impl/data/NumberDataFormatter.java
+6
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
...src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCAbstractValueHandler.java
...beaver/model/impl/jdbc/data/JDBCAbstractValueHandler.java
+9
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCArray.java
...src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCArray.java
+4
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCCursor.java
...rc/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCCursor.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCNumberValueHandler.java
.../dbeaver/model/impl/jdbc/data/JDBCNumberValueHandler.java
+37
-50
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCStruct.java
...rc/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCStruct.java
+3
-8
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCCallableStatementImpl.java
...eaver/model/impl/jdbc/exec/JDBCCallableStatementImpl.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCColumnMetaData.java
...kiss/dbeaver/model/impl/jdbc/exec/JDBCColumnMetaData.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCConnectionImpl.java
...kiss/dbeaver/model/impl/jdbc/exec/JDBCConnectionImpl.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCDataRequest.java
...g/jkiss/dbeaver/model/impl/jdbc/exec/JDBCDataRequest.java
+66
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCDatabaseMetaDataImpl.java
...beaver/model/impl/jdbc/exec/JDBCDatabaseMetaDataImpl.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCFakeStatementImpl.java
...s/dbeaver/model/impl/jdbc/exec/JDBCFakeStatementImpl.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCPreparedStatementImpl.java
...eaver/model/impl/jdbc/exec/JDBCPreparedStatementImpl.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCResultSetImpl.java
...jkiss/dbeaver/model/impl/jdbc/exec/JDBCResultSetImpl.java
+1
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCResultSetMetaData.java
...s/dbeaver/model/impl/jdbc/exec/JDBCResultSetMetaData.java
+1
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCSavepointImpl.java
...jkiss/dbeaver/model/impl/jdbc/exec/JDBCSavepointImpl.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCStatementImpl.java
...jkiss/dbeaver/model/impl/jdbc/exec/JDBCStatementImpl.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCTableIdentifier.java
...iss/dbeaver/model/impl/jdbc/exec/JDBCTableIdentifier.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCTableMetaData.java
...jkiss/dbeaver/model/impl/jdbc/exec/JDBCTableMetaData.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCVoidStatementImpl.java
...s/dbeaver/model/impl/jdbc/exec/JDBCVoidStatementImpl.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/struct/DBSDataContainer.java
.../src/org/jkiss/dbeaver/model/struct/DBSDataContainer.java
+3
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/RuntimeUtils.java
...aver.core/src/org/jkiss/dbeaver/runtime/RuntimeUtils.java
+5
-5
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
....jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
+32
-13
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/CustomNumberCellEditor.java
...org/jkiss/dbeaver/ui/controls/CustomNumberCellEditor.java
+3
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
.../jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
+0
-3
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ViewValuePanel.java
...g/jkiss/dbeaver/ui/controls/resultset/ViewValuePanel.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/spreadsheet/Spreadsheet.java
...rg/jkiss/dbeaver/ui/controls/spreadsheet/Spreadsheet.java
+3
-10
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/CursorViewDialog.java
...c/org/jkiss/dbeaver/ui/dialogs/data/CursorViewDialog.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/NumberViewDialog.java
...c/org/jkiss/dbeaver/ui/dialogs/data/NumberViewDialog.java
+24
-85
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/TextViewDialog.java
...src/org/jkiss/dbeaver/ui/dialogs/data/TextViewDialog.java
+37
-34
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
...rc/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
+97
-6
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
...c/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
+7
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
....core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/perspective/DataSourceManagementToolbar.java
...s/dbeaver/ui/perspective/DataSourceManagementToolbar.java
+1
-1
plugins/org.jkiss.dbeaver.mysql/src/org/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
...rg/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
+1
-1
plugins/org.jkiss.dbeaver.oracle/src/org/jkiss/dbeaver/ext/oracle/views/OracleConnectionPage.java
.../jkiss/dbeaver/ext/oracle/views/OracleConnectionPage.java
+1
-1
未找到文件。
modules/org.jkiss.utils/src/org/jkiss/utils/CommonUtils.java
浏览文件 @
a1ba0624
...
...
@@ -257,13 +257,22 @@ public class CommonUtils {
public
static
boolean
contains
(
short
[]
array
,
short
value
)
{
if
(
isEmpty
(
array
))
return
false
;
for
(
short
v
:
array
)
{
if
(
v
==
value
)
return
true
;
}
for
(
int
i
=
0
,
arrayLength
=
array
.
length
;
i
<
arrayLength
;
i
++
)
{
if
(
array
[
i
]
==
value
)
return
true
;
}
return
false
;
}
public
static
boolean
isEmpty
(
int
[]
array
)
public
static
boolean
contains
(
char
[]
array
,
char
value
)
{
if
(
array
==
null
||
array
.
length
==
0
)
return
false
;
for
(
int
i
=
0
,
arrayLength
=
array
.
length
;
i
<
arrayLength
;
i
++)
{
if
(
array
[
i
]
==
value
)
return
true
;
}
return
false
;
}
public
static
boolean
isEmpty
(
int
[]
array
)
{
return
array
==
null
||
array
.
length
==
0
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/SQLUtils.java
浏览文件 @
a1ba0624
...
...
@@ -19,6 +19,8 @@
package
org.jkiss.dbeaver.model
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.struct.DBSDataKind
;
import
org.jkiss.dbeaver.model.struct.DBSTypedObject
;
import
org.jkiss.dbeaver.ui.editors.sql.format.SQLFormatter
;
import
org.jkiss.dbeaver.ui.editors.sql.format.SQLFormatterConfiguration
;
import
org.jkiss.dbeaver.ui.editors.sql.syntax.SQLSyntaxManager
;
...
...
@@ -127,6 +129,15 @@ public final class SQLUtils {
return
pattern
.
matcher
(
string
).
matches
();
}
public
static
void
appendValue
(
StringBuilder
buffer
,
DBSTypedObject
type
,
Object
value
)
{
if
(
type
.
getDataKind
()
==
DBSDataKind
.
NUMERIC
||
type
.
getDataKind
()
==
DBSDataKind
.
BOOLEAN
)
{
buffer
.
append
(
value
);
}
else
{
buffer
.
append
(
'\''
).
append
(
value
).
append
(
'\''
);
}
}
public
static
String
escapeString
(
String
string
)
{
return
string
.
replaceAll
(
"'"
,
"\\'"
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/data/DBDValueEditor.java
浏览文件 @
a1ba0624
...
...
@@ -19,6 +19,7 @@
package
org.jkiss.dbeaver.model.data
;
import
org.eclipse.swt.widgets.Control
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
...
...
@@ -28,6 +29,8 @@ import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
*/
public
interface
DBDValueEditor
{
Control
getControl
();
Object
extractValue
(
DBRProgressMonitor
monitor
)
throws
DBException
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/exec/DBCDataRequest.java
0 → 100644
浏览文件 @
a1ba0624
package
org.jkiss.dbeaver.model.exec
;
import
org.jkiss.dbeaver.model.data.DBDAttributeValue
;
import
org.jkiss.dbeaver.model.data.DBDDataFilter
;
import
org.jkiss.dbeaver.model.data.DBDDataReceiver
;
import
java.util.List
;
/**
* Data request
*/
public
interface
DBCDataRequest
{
void
setDataReceiver
(
DBDDataReceiver
dataReceiver
);
void
setDataFilter
(
DBDDataFilter
dataFilter
);
void
setLimit
(
long
firstRow
,
long
maxRows
);
void
setKeys
(
List
<
DBDAttributeValue
>
attributes
);
void
setData
(
List
<
DBDAttributeValue
>
attributes
);
long
execute
(
DBCExecutionContext
context
);
long
getResult
();
String
generateScript
(
DBCExecutionContext
context
);
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/data/NumberDataFormatter.java
浏览文件 @
a1ba0624
...
...
@@ -72,7 +72,9 @@ public class NumberDataFormatter implements DBDDataFormatter {
return
null
;
}
try
{
return
numberFormat
.
format
(
value
);
synchronized
(
numberFormat
)
{
return
numberFormat
.
format
(
value
);
}
}
catch
(
Exception
e
)
{
return
value
.
toString
();
}
...
...
@@ -81,7 +83,9 @@ public class NumberDataFormatter implements DBDDataFormatter {
@Override
public
Object
parseValue
(
String
value
)
throws
ParseException
{
return
numberFormat
.
parse
(
value
);
synchronized
(
numberFormat
)
{
return
numberFormat
.
parse
(
value
);
}
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
浏览文件 @
a1ba0624
...
...
@@ -27,7 +27,7 @@ import org.jkiss.dbeaver.model.exec.*;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCConnector
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCDatabaseMetaData
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.jdbc.
api
.JDBCConnectionImpl
;
import
org.jkiss.dbeaver.model.impl.jdbc.
exec
.JDBCConnectionImpl
;
import
org.jkiss.dbeaver.model.meta.Property
;
import
org.jkiss.dbeaver.model.qm.QMUtils
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCAbstractValueHandler.java
浏览文件 @
a1ba0624
...
...
@@ -161,6 +161,12 @@ public abstract class JDBCAbstractValueHandler implements DBDValueHandler {
}
}
@Override
public
Control
getControl
()
{
return
control
;
}
public
abstract
Object
extractValue
(
DBRProgressMonitor
monitor
)
throws
DBException
;
protected
abstract
T
createControl
(
Composite
editPlaceholder
);
...
...
@@ -183,9 +189,9 @@ public abstract class JDBCAbstractValueHandler implements DBDValueHandler {
boolean
isInline
=
(
valueController
.
getEditType
()
==
DBDValueController
.
EditType
.
INLINE
);
if
(!
isInline
)
{
inlineControl
.
setBackground
(
valueController
.
getEditPlaceholder
().
getBackground
());
}
//
if (!isInline) {
//
inlineControl.setBackground(valueController.getEditPlaceholder().getBackground());
//
}
if
(
isInline
)
{
inlineControl
.
setFont
(
valueController
.
getEditPlaceholder
().
getFont
());
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCArray.java
浏览文件 @
a1ba0624
...
...
@@ -24,6 +24,7 @@ import org.jkiss.dbeaver.core.CoreMessages;
import
org.jkiss.dbeaver.model.DBConstants
;
import
org.jkiss.dbeaver.model.DBPDataTypeProvider
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.SQLUtils
;
import
org.jkiss.dbeaver.model.data.DBDArray
;
import
org.jkiss.dbeaver.model.data.DBDValue
;
import
org.jkiss.dbeaver.model.data.DBDValueCloneable
;
...
...
@@ -31,7 +32,7 @@ import org.jkiss.dbeaver.model.data.DBDValueHandler;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.DBCResultSet
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.jdbc.
api
.JDBCResultSetImpl
;
import
org.jkiss.dbeaver.model.impl.jdbc.
exec
.JDBCResultSetImpl
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.DBSDataType
;
...
...
@@ -186,12 +187,8 @@ public class JDBCArray implements DBDArray, DBDValueCloneable {
if
(
str
.
length
()
>
0
)
{
str
.
append
(
","
);
//$NON-NLS-1$
}
if
(
item
instanceof
Number
)
{
str
.
append
(
item
);
}
else
{
String
itemString
=
valueHandler
.
getValueDisplayString
(
type
,
item
);
str
.
append
(
itemString
);
}
String
itemString
=
valueHandler
.
getValueDisplayString
(
type
,
item
);
SQLUtils
.
appendValue
(
str
,
type
,
itemString
);
}
return
str
.
toString
();
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCCursor.java
浏览文件 @
a1ba0624
...
...
@@ -24,7 +24,7 @@ import org.jkiss.dbeaver.core.CoreMessages;
import
org.jkiss.dbeaver.model.data.DBDCursor
;
import
org.jkiss.dbeaver.model.data.DBDValue
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.jdbc.
api
.JDBCResultSetImpl
;
import
org.jkiss.dbeaver.model.impl.jdbc.
exec
.JDBCResultSetImpl
;
import
java.sql.ResultSet
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCNumberValueHandler.java
浏览文件 @
a1ba0624
...
...
@@ -45,7 +45,9 @@ import org.jkiss.utils.CommonUtils;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.sql.SQLException
;
import
java.sql.Types
;
import
java.text.DecimalFormatSymbols
;
import
java.text.ParseException
;
import
java.util.Locale
;
/**
* JDBC number value handler
...
...
@@ -57,11 +59,13 @@ public class JDBCNumberValueHandler extends JDBCAbstractValueHandler {
private
static
final
String
BAD_DOUBLE_VALUE
=
"2.2250738585072012e-308"
;
//$NON-NLS-1$
private
Locale
locale
;
private
DBDDataFormatter
formatter
;
public
JDBCNumberValueHandler
(
DBDDataFormatterProfile
formatterProfile
)
{
try
{
locale
=
formatterProfile
.
getLocale
();
formatter
=
formatterProfile
.
createFormatter
(
TYPE_NAME_NUMBER
);
}
catch
(
Exception
e
)
{
log
.
error
(
"Could not create formatter for number value handler"
,
e
);
//$NON-NLS-1$
...
...
@@ -236,20 +240,21 @@ public class JDBCNumberValueHandler extends JDBCAbstractValueHandler {
case
java
.
sql
.
Types
.
SMALLINT
:
case
java
.
sql
.
Types
.
TINYINT
:
case
java
.
sql
.
Types
.
BIT
:
editor
.
addVerifyListener
(
UIUtils
.
INTEGER_VERIFY_LISTENER
);
editor
.
addVerifyListener
(
UIUtils
.
getIntegerVerifyListener
()
);
break
;
default
:
editor
.
addVerifyListener
(
UIUtils
.
NUMBER_VERIFY_LISTENER
);
editor
.
addVerifyListener
(
UIUtils
.
getNumberVerifyListener
(
locale
)
);
break
;
}
editor
.
setEditable
(!
valueController
.
isReadOnly
());
return
editor
;
}
@Override
public
void
refreshValue
()
{
Object
value
=
valueController
.
getValue
();
control
.
setText
(
value
==
null
?
""
:
value
.
toString
());
//$NON-NLS-1$
if
(
value
!=
null
)
{
control
.
setText
(
getValueDisplayString
(
valueController
.
getAttributeMetaData
(),
value
));
//$NON-NLS-1$
}
if
(
valueController
.
getEditType
()
==
DBDValueController
.
EditType
.
INLINE
)
{
control
.
selectAll
();
}
...
...
@@ -261,7 +266,7 @@ public class JDBCNumberValueHandler extends JDBCAbstractValueHandler {
if
(
CommonUtils
.
isEmpty
(
text
))
{
return
null
;
}
return
convertStringToNumber
(
text
,
valueController
.
getValue
(),
valueController
.
getAttributeMetaData
());
return
convertStringToNumber
(
formatter
,
text
,
valueController
.
getValue
(),
valueController
.
getAttributeMetaData
());
}
};
}
...
...
@@ -292,32 +297,7 @@ public class JDBCNumberValueHandler extends JDBCAbstractValueHandler {
}
else
if
(
object
instanceof
Number
)
{
return
object
;
}
else
if
(
object
instanceof
String
)
{
String
strValue
=
(
String
)
object
;
try
{
switch
(
type
.
getTypeID
())
{
case
java
.
sql
.
Types
.
BIGINT
:
return
Long
.
valueOf
(
strValue
);
case
java
.
sql
.
Types
.
DOUBLE
:
case
java
.
sql
.
Types
.
REAL
:
return
Double
.
valueOf
(
strValue
);
case
java
.
sql
.
Types
.
FLOAT
:
return
Float
.
valueOf
(
strValue
);
case
java
.
sql
.
Types
.
INTEGER
:
return
Integer
.
valueOf
(
strValue
);
case
java
.
sql
.
Types
.
SMALLINT
:
return
Short
.
valueOf
(
strValue
);
case
java
.
sql
.
Types
.
TINYINT
:
case
java
.
sql
.
Types
.
BIT
:
return
Byte
.
valueOf
(
strValue
);
case
Types
.
NUMERIC
:
return
new
BigDecimal
(
strValue
);
default
:
// Here may be any numeric value. BigDecimal or BigInteger for example
return
new
BigDecimal
(
strValue
);
}
}
catch
(
NumberFormatException
e
)
{
return
null
;
}
return
convertStringToNumber
(
formatter
,
(
String
)
object
,
null
,
type
);
}
else
{
log
.
warn
(
"Unrecognized type '"
+
object
.
getClass
().
getName
()
+
"' - can't convert to numeric"
);
return
null
;
...
...
@@ -337,28 +317,35 @@ public class JDBCNumberValueHandler extends JDBCAbstractValueHandler {
controller
.
getAttributeMetaData
().
getScale
());
}
public
static
Number
convertStringToNumber
(
String
text
,
Object
originalValue
,
DBSTypedObject
type
)
public
static
Number
convertStringToNumber
(
DBDDataFormatter
formatter
,
String
text
,
Object
originalValue
,
DBSTypedObject
type
)
{
if
(
text
==
null
||
text
.
length
()
==
0
)
{
return
null
;
}
try
{
if
(
originalValue
instanceof
Long
)
{
return
Long
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Integer
)
{
return
Integer
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Short
)
{
return
Short
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Byte
)
{
return
Byte
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Float
)
{
return
Float
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Double
)
{
return
Double
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
BigInteger
)
{
return
new
BigInteger
(
text
);
}
else
if
(
originalValue
instanceof
BigDecimal
)
{
return
new
BigDecimal
(
text
);
return
(
Number
)
formatter
.
parseValue
(
text
);
}
catch
(
ParseException
e
)
{
log
.
debug
(
"Can't parse numeric value using formatter"
,
e
);
}
try
{
if
(
originalValue
instanceof
Number
)
{
if
(
originalValue
instanceof
Long
)
{
return
Long
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Integer
)
{
return
Integer
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Short
)
{
return
Short
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Byte
)
{
return
Byte
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Float
)
{
return
Float
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
Double
)
{
return
Double
.
valueOf
(
text
);
}
else
if
(
originalValue
instanceof
BigInteger
)
{
return
new
BigInteger
(
text
);
}
else
{
return
new
BigDecimal
(
text
);
}
}
else
{
switch
(
type
.
getTypeID
())
{
case
java
.
sql
.
Types
.
BIGINT
:
...
...
@@ -386,7 +373,7 @@ public class JDBCNumberValueHandler extends JDBCAbstractValueHandler {
}
}
}
catch
(
NumberFormatException
e
)
{
log
.
error
(
"Bad numeric value '"
+
text
+
"' - "
+
e
.
getMessage
());
//$NON-NLS-1$ //$NON-NLS-2$
log
.
debug
(
"Bad numeric value '"
+
text
+
"' - "
+
e
.
getMessage
());
//$NON-NLS-1$ //$NON-NLS-2$
return
null
;
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCStruct.java
浏览文件 @
a1ba0624
...
...
@@ -22,6 +22,7 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.SQLUtils
;
import
org.jkiss.dbeaver.model.data.DBDStructure
;
import
org.jkiss.dbeaver.model.data.DBDValue
;
import
org.jkiss.dbeaver.model.data.DBDValueCloneable
;
...
...
@@ -154,14 +155,8 @@ public class JDBCStruct implements DBDStructure, DBDValueCloneable {
str
.
append
(
"NULL"
);
}
else
{
DBDValueHandler
valueHandler
=
DBUtils
.
findValueHandler
(
type
.
getDataSource
(),
entry
.
getKey
());
if
(
item
instanceof
Number
)
{
str
.
append
(
item
);
}
else
{
String
strValue
=
valueHandler
.
getValueDisplayString
(
entry
.
getKey
(),
item
);
str
.
append
(
'\''
);
str
.
append
(
strValue
);
str
.
append
(
'\''
);
}
String
strValue
=
valueHandler
.
getValueDisplayString
(
entry
.
getKey
(),
item
);
SQLUtils
.
appendValue
(
str
,
entry
.
getKey
(),
strValue
);
}
i
++;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCCallableStatementImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCCallableStatementImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCCallableStatement
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
db
c/JDBCColumnMetaData.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exe
c/JDBCColumnMetaData.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
db
c
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exe
c
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCConnectionImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCConnectionImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCDataRequest.java
0 → 100644
浏览文件 @
a1ba0624
package
org.jkiss.dbeaver.model.impl.jdbc.exec
;
import
org.jkiss.dbeaver.model.data.DBDAttributeValue
;
import
org.jkiss.dbeaver.model.data.DBDDataFilter
;
import
org.jkiss.dbeaver.model.data.DBDDataReceiver
;
import
org.jkiss.dbeaver.model.exec.DBCDataRequest
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
java.util.List
;
/**
* JDBC data request
*/
public
abstract
class
JDBCDataRequest
implements
DBCDataRequest
{
protected
DBDDataReceiver
dataReceiver
;
protected
DBDDataFilter
dataFilter
;
protected
long
firstRow
;
protected
long
maxRows
;
protected
List
<
DBDAttributeValue
>
keys
;
protected
List
<
DBDAttributeValue
>
data
;
protected
long
result
;
protected
StringBuilder
script
=
new
StringBuilder
();
@Override
public
void
setDataReceiver
(
DBDDataReceiver
dataReceiver
)
{
this
.
dataReceiver
=
dataReceiver
;
}
@Override
public
void
setDataFilter
(
DBDDataFilter
dataFilter
)
{
this
.
dataFilter
=
dataFilter
;
}
@Override
public
void
setLimit
(
long
firstRow
,
long
maxRows
)
{
this
.
firstRow
=
firstRow
;
this
.
maxRows
=
maxRows
;
}
@Override
public
void
setKeys
(
List
<
DBDAttributeValue
>
attributes
)
{
this
.
keys
=
attributes
;
}
@Override
public
void
setData
(
List
<
DBDAttributeValue
>
attributes
)
{
this
.
data
=
attributes
;
}
@Override
public
long
getResult
()
{
return
this
.
result
;
}
@Override
public
String
generateScript
(
DBCExecutionContext
context
)
{
return
this
.
script
.
toString
();
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCDatabaseMetaDataImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCDatabaseMetaDataImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCDatabaseMetaData
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCFakeStatementImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCFakeStatementImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCPreparedStatementImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCPreparedStatementImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCResultSetImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCResultSetImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
@@ -26,7 +26,6 @@ import org.jkiss.dbeaver.model.exec.DBCResultSetMetaData;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils
;
import
org.jkiss.dbeaver.model.impl.jdbc.dbc.JDBCResultSetMetaData
;
import
org.jkiss.dbeaver.model.qm.QMUtils
;
import
java.io.InputStream
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
db
c/JDBCResultSetMetaData.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exe
c/JDBCResultSetMetaData.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
db
c
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exe
c
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.exec.DBCAttributeMetaData
;
...
...
@@ -24,7 +24,6 @@ import org.jkiss.dbeaver.model.exec.DBCException;
import
org.jkiss.dbeaver.model.exec.DBCResultSet
;
import
org.jkiss.dbeaver.model.exec.DBCResultSetMetaData
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils
;
import
org.jkiss.dbeaver.model.impl.jdbc.api.JDBCResultSetImpl
;
import
org.jkiss.dbeaver.model.struct.DBSDataSourceContainer
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.rdb.DBSTable
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCSavepointImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCSavepointImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCStatementImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCStatementImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
db
c/JDBCTableIdentifier.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exe
c/JDBCTableIdentifier.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
db
c
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exe
c
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.exec.DBCAttributeMetaData
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
db
c/JDBCTableMetaData.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exe
c/JDBCTableMetaData.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
db
c
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exe
c
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
api
/JDBCVoidStatementImpl.java
→
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/
exec
/JDBCVoidStatementImpl.java
浏览文件 @
a1ba0624
...
...
@@ -16,7 +16,7 @@
* 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.jdbc.
api
;
package
org.jkiss.dbeaver.model.impl.jdbc.
exec
;
import
java.io.InputStream
;
import
java.io.Reader
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/struct/DBSDataContainer.java
浏览文件 @
a1ba0624
...
...
@@ -23,6 +23,7 @@ import org.jkiss.dbeaver.DBException;
import
org.jkiss.dbeaver.model.data.DBDAttributeValue
;
import
org.jkiss.dbeaver.model.data.DBDDataFilter
;
import
org.jkiss.dbeaver.model.data.DBDDataReceiver
;
import
org.jkiss.dbeaver.model.exec.DBCDataRequest
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
java.util.List
;
...
...
@@ -43,6 +44,8 @@ public interface DBSDataContainer extends DBSObject {
int
getSupportedFeatures
();
//DBCDataRequest makeDataRequest(DBCExecutionContext context, int type);
long
readData
(
DBCExecutionContext
context
,
DBDDataReceiver
dataReceiver
,
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/runtime/RuntimeUtils.java
浏览文件 @
a1ba0624
...
...
@@ -258,7 +258,7 @@ public class RuntimeUtils {
if
(
valueType
==
null
||
CharSequence
.
class
.
isAssignableFrom
(
valueType
))
{
return
value
;
}
else
if
(
valueType
==
Long
.
class
)
{
return
new
Long
(
value
);
return
Long
.
valueOf
(
value
);
}
else
if
(
valueType
==
Long
.
TYPE
)
{
return
Long
.
parseLong
(
value
);
}
else
if
(
valueType
==
Integer
.
class
)
{
...
...
@@ -266,19 +266,19 @@ public class RuntimeUtils {
}
else
if
(
valueType
==
Integer
.
TYPE
)
{
return
Integer
.
parseInt
(
value
);
}
else
if
(
valueType
==
Short
.
class
)
{
return
new
Short
(
value
);
return
Short
.
valueOf
(
value
);
}
else
if
(
valueType
==
Short
.
TYPE
)
{
return
Short
.
parseShort
(
value
);
}
else
if
(
valueType
==
Byte
.
class
)
{
return
new
Byte
(
value
);
return
Byte
.
valueOf
(
value
);
}
else
if
(
valueType
==
Byte
.
TYPE
)
{
return
Byte
.
parseByte
(
value
);
}
else
if
(
valueType
==
Double
.
class
)
{
return
new
Double
(
value
);
return
Double
.
valueOf
(
value
);
}
else
if
(
valueType
==
Double
.
TYPE
)
{
return
Double
.
parseDouble
(
value
);
}
else
if
(
valueType
==
Float
.
class
)
{
return
new
Float
(
value
);
return
Float
.
valueOf
(
value
);
}
else
if
(
valueType
==
Float
.
TYPE
)
{
return
Float
.
parseFloat
(
value
);
}
else
if
(
valueType
==
BigInteger
.
class
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/UIUtils.java
浏览文件 @
a1ba0624
...
...
@@ -59,6 +59,7 @@ import org.jkiss.utils.CommonUtils;
import
java.lang.reflect.Method
;
import
java.nio.charset.Charset
;
import
java.text.DecimalFormatSymbols
;
import
java.text.MessageFormat
;
import
java.text.NumberFormat
;
import
java.util.*
;
...
...
@@ -73,7 +74,7 @@ public class UIUtils {
public
static
final
char
PARAGRAPH_CHAR
=
(
char
)
182
;
p
ublic
static
final
VerifyListener
INTEGER_VERIFY_LISTENER
=
new
VerifyListener
()
{
p
rivate
static
final
VerifyListener
INTEGER_VERIFY_LISTENER
=
new
VerifyListener
()
{
@Override
public
void
verifyText
(
VerifyEvent
e
)
{
...
...
@@ -88,20 +89,38 @@ public class UIUtils {
}
};
public
static
final
VerifyListener
NUMBER_VERIFY_LISTENER
=
new
VerifyListener
()
{
@Override
public
void
verifyText
(
VerifyEvent
e
)
{
for
(
int
i
=
0
;
i
<
e
.
text
.
length
();
i
++)
{
char
ch
=
e
.
text
.
charAt
(
i
);
if
(!
Character
.
isDigit
(
ch
)
&&
ch
!=
'.'
&&
ch
!=
'-'
&&
ch
!=
'e'
&&
ch
!=
'E'
)
{
e
.
doit
=
false
;
return
;
public
static
VerifyListener
getIntegerVerifyListener
()
{
return
INTEGER_VERIFY_LISTENER
;
}
public
static
VerifyListener
getNumberVerifyListener
(
Locale
locale
)
{
DecimalFormatSymbols
symbols
=
DecimalFormatSymbols
.
getInstance
(
locale
);
final
char
[]
allowedChars
=
new
char
[]
{
symbols
.
getDecimalSeparator
(),
symbols
.
getGroupingSeparator
(),
symbols
.
getMinusSign
(),
symbols
.
getZeroDigit
(),
symbols
.
getMonetaryDecimalSeparator
(),
'+'
};
final
String
exponentSeparator
=
symbols
.
getExponentSeparator
();
return
new
VerifyListener
()
{
@Override
public
void
verifyText
(
VerifyEvent
e
)
{
for
(
int
i
=
0
;
i
<
e
.
text
.
length
();
i
++)
{
char
ch
=
e
.
text
.
charAt
(
i
);
if
(!
Character
.
isDigit
(
ch
)
&&
!
CommonUtils
.
contains
(
allowedChars
,
ch
)
&&
exponentSeparator
.
indexOf
(
ch
)
==
-
1
)
{
e
.
doit
=
false
;
return
;
}
}
e
.
doit
=
true
;
}
e
.
doit
=
true
;
}
};
};
}
public
static
Object
makeStringForUI
(
Object
object
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/CustomNumberCellEditor.java
浏览文件 @
a1ba0624
...
...
@@ -27,6 +27,7 @@ import org.jkiss.dbeaver.ui.UIUtils;
import
org.jkiss.utils.CommonUtils
;
import
java.math.BigDecimal
;
import
java.util.Locale
;
/**
* Number cell editor
...
...
@@ -52,9 +53,9 @@ public class CustomNumberCellEditor extends TextCellEditor {
valueType
==
Double
.
TYPE
||
valueType
==
BigDecimal
.
class
)
{
text
.
addVerifyListener
(
UIUtils
.
NUMBER_VERIFY_LISTENER
);
text
.
addVerifyListener
(
UIUtils
.
getNumberVerifyListener
(
Locale
.
getDefault
())
);
}
else
{
text
.
addVerifyListener
(
UIUtils
.
INTEGER_VERIFY_LISTENER
);
text
.
addVerifyListener
(
UIUtils
.
getIntegerVerifyListener
()
);
}
return
text
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
浏览文件 @
a1ba0624
...
...
@@ -3167,9 +3167,6 @@ public class ResultSetViewer extends Viewer implements IDataSourceProvider, ISpr
Object
getValue
(
ResultSetViewer
viewer
,
DBDAttributeBinding
column
,
boolean
useDefault
)
{
Object
value
=
viewer
.
curRows
.
get
(
viewer
.
getCurrentRow
())[
viewer
.
getMetaColumnIndex
(
column
.
getAttribute
())];
if
(
value
instanceof
Number
)
{
return
value
.
toString
();
}
return
column
.
getValueHandler
().
getValueDisplayString
(
column
.
getAttribute
(),
value
);
}
},
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/resultset/ViewValuePanel.java
浏览文件 @
a1ba0624
...
...
@@ -44,7 +44,7 @@ abstract class ViewValuePanel extends Composite {
gl
.
marginHeight
=
0
;
gl
.
marginWidth
=
0
;
setLayout
(
gl
);
this
.
setBackground
(
this
.
getDisplay
().
getSystemColor
(
SWT
.
COLOR_LIST_BACKGROUND
));
//
this.setBackground(this.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
this
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
Color
infoBackground
=
getDisplay
().
getSystemColor
(
SWT
.
COLOR_WIDGET_BACKGROUND
);
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/controls/spreadsheet/Spreadsheet.java
浏览文件 @
a1ba0624
...
...
@@ -509,17 +509,10 @@ public class Spreadsheet extends LightGrid implements Listener {
}
prevCol
=
pos
.
col
;
}
// Make some formatting
// We don't want to use locale-specific formatter because numbers and dates
// become not valid for SQL queries
Object
element
=
contentProvider
.
getElement
(
pos
);
String
text
;
if
(
element
instanceof
Number
)
{
text
=
element
.
toString
();
}
else
{
text
=
contentLabelProvider
.
getText
(
pos
);
String
text
=
contentLabelProvider
.
getText
(
pos
);
if
(
text
!=
null
)
{
tdt
.
append
(
text
);
}
tdt
.
append
(
text
==
null
?
""
:
text
);
}
if
(
tdt
.
length
()
>
0
)
{
TextTransfer
textTransfer
=
TextTransfer
.
getInstance
();
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/CursorViewDialog.java
浏览文件 @
a1ba0624
...
...
@@ -133,7 +133,7 @@ public class CursorViewDialog extends ValueViewDialog implements ResultSetProvid
public
int
getSupportedFeatures
()
{
// Nothing but plain read
return
0
;
return
DATA_SELECT
;
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/NumberViewDialog.java
浏览文件 @
a1ba0624
...
...
@@ -20,24 +20,22 @@
package
org.jkiss.dbeaver.ui.dialogs.data
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.layout.FillLayout
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.widgets.*
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.data.DBDValueController
;
import
org.jkiss.dbeaver.model.impl.jdbc.data.JDBCNumberValueHandler
;
import
org.jkiss.dbeaver.model.data.DBDValueEditor
;
import
org.jkiss.dbeaver.runtime.VoidProgressMonitor
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
java.sql.Types
;
/**
* TextViewDialog
*/
public
class
NumberViewDialog
extends
ValueViewDialog
{
private
Text
textEdit
;
private
Combo
bitEdit
;
private
boolean
isBoolean
=
false
;
private
Object
value
;
private
DBDValueEditor
panelEditor
;
public
NumberViewDialog
(
DBDValueController
valueController
)
{
super
(
valueController
);
...
...
@@ -46,95 +44,37 @@ public class NumberViewDialog extends ValueViewDialog {
@Override
protected
Control
createDialogArea
(
Composite
parent
)
{
DBDValueController
valueController
=
getValueController
();
value
=
valueController
.
getValue
();
Composite
dialogGroup
=
(
Composite
)
super
.
createDialogArea
(
parent
);
Label
label
=
new
Label
(
dialogGroup
,
SWT
.
NONE
);
label
.
setText
(
CoreMessages
.
dialog_data_label_value
);
int
style
=
SWT
.
BORDER
;
if
(
getValueController
().
isReadOnly
())
{
style
|=
SWT
.
READ_ONLY
;
}
int
valueType
=
getValueController
().
getAttributeMetaData
().
getTypeID
();
if
(
valueType
==
Types
.
BIT
||
valueType
==
Types
.
BOOLEAN
)
{
// Bit (boolean)
style
|=
SWT
.
READ_ONLY
;
bitEdit
=
new
Combo
(
dialogGroup
,
style
);
if
(
valueType
==
Types
.
BOOLEAN
||
value
instanceof
Boolean
)
{
isBoolean
=
true
;
bitEdit
.
add
(
"FALSE"
);
bitEdit
.
add
(
"TRUE"
);
Boolean
boolValue
=
((
Boolean
)
value
);
bitEdit
.
select
(
Boolean
.
TRUE
.
equals
(
boolValue
)
?
1
:
0
);
}
else
{
bitEdit
.
add
(
"0 (FALSE)"
);
bitEdit
.
add
(
"1 (TRUE)"
);
int
intValue
=
((
Number
)
value
).
intValue
();
bitEdit
.
select
(
intValue
==
0
?
0
:
1
);
}
GridData
gd
=
new
GridData
(
GridData
.
FILL_BOTH
);
gd
.
widthHint
=
50
;
gd
.
grabExcessVerticalSpace
=
true
;
bitEdit
.
setLayoutData
(
gd
);
bitEdit
.
setFocus
();
bitEdit
.
setEnabled
(!
getValueController
().
isReadOnly
());
}
else
{
// Numbers
textEdit
=
new
Text
(
dialogGroup
,
style
);
switch
(
getValueController
().
getAttributeMetaData
().
getTypeID
())
{
case
java
.
sql
.
Types
.
BIGINT
:
case
java
.
sql
.
Types
.
INTEGER
:
case
java
.
sql
.
Types
.
SMALLINT
:
case
java
.
sql
.
Types
.
TINYINT
:
case
java
.
sql
.
Types
.
BIT
:
textEdit
.
addVerifyListener
(
UIUtils
.
INTEGER_VERIFY_LISTENER
);
break
;
default
:
textEdit
.
addVerifyListener
(
UIUtils
.
NUMBER_VERIFY_LISTENER
);
break
;
}
if
(
value
!=
null
)
{
// Use simple toString() because we don't want formatted values.
textEdit
.
setText
(
value
.
toString
());
}
int
maxSize
=
getValueController
().
getAttributeMetaData
().
getPrecision
();
if
(
maxSize
>
0
)
{
textEdit
.
setTextLimit
(
maxSize
+
2
);
}
textEdit
.
setBackground
(
getShell
().
getDisplay
().
getSystemColor
(
SWT
.
COLOR_WHITE
));
GridData
gd
=
new
GridData
(
GridData
.
FILL_HORIZONTAL
);
gd
.
widthHint
=
300
;
//gd.grabExcessVerticalSpace = true;
textEdit
.
setLayoutData
(
gd
);
textEdit
.
setFocus
();
textEdit
.
setEditable
(!
getValueController
().
isReadOnly
());
Composite
editorPlaceholder
=
UIUtils
.
createPlaceholder
(
dialogGroup
,
1
);
editorPlaceholder
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
editorPlaceholder
.
setLayout
(
new
FillLayout
());
if
(
super
.
isForeignKey
())
{
super
.
createEditorSelector
(
dialogGroup
,
textEdit
);
}
try
{
panelEditor
=
createPanelEditor
(
editorPlaceholder
);
panelEditor
.
refreshValue
();
}
catch
(
DBException
e
)
{
log
.
error
(
e
);
return
dialogGroup
;
}
if
(
super
.
isForeignKey
()
&&
panelEditor
.
getControl
()
instanceof
Text
)
{
super
.
createEditorSelector
(
dialogGroup
,
(
Text
)
panelEditor
.
getControl
());
}
return
dialogGroup
;
}
@Override
protected
Object
getEditorValue
()
{
if
(
textEdit
!=
null
)
{
return
JDBCNumberValueHandler
.
convertStringToNumber
(
textEdit
.
getText
(),
value
,
getValueController
().
getAttributeMetaData
());
}
else
if
(
bitEdit
!=
null
)
{
if
(
isBoolean
)
{
return
bitEdit
.
getSelectionIndex
()
==
0
?
Boolean
.
FALSE
:
Boolean
.
TRUE
;
}
else
{
return
(
byte
)
bitEdit
.
getSelectionIndex
();
}
}
else
{
try
{
return
panelEditor
.
extractValue
(
VoidProgressMonitor
.
INSTANCE
);
}
catch
(
DBException
e
)
{
// NEver be here
log
.
error
(
e
);
return
null
;
}
}
...
...
@@ -142,7 +82,6 @@ public class NumberViewDialog extends ValueViewDialog {
@Override
public
void
refreshValue
()
{
value
=
getValueController
().
getValue
();
textEdit
.
setText
(
value
.
toString
());
panelEditor
.
refreshValue
();
}
}
\ No newline at end of file
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/TextViewDialog.java
浏览文件 @
a1ba0624
...
...
@@ -81,12 +81,14 @@ public class TextViewDialog extends ValueViewDialog {
boolean
readOnly
=
getValueController
().
isReadOnly
();
boolean
useHex
=
!
isForeignKey
;
long
maxSize
=
getValueController
().
getAttributeMetaData
().
getMaxLength
();
editorContainer
=
new
CTabFolder
(
dialogGroup
,
SWT
.
FLAT
|
SWT
.
TOP
);
editorContainer
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
if
(
useHex
)
{
editorContainer
=
new
CTabFolder
(
dialogGroup
,
SWT
.
FLAT
|
SWT
.
TOP
);
editorContainer
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_BOTH
));
lengthLabel
=
new
Label
(
editorContainer
,
SWT
.
RIGHT
);
lengthLabel
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
editorContainer
.
setTopRight
(
lengthLabel
,
SWT
.
FILL
);
lengthLabel
=
new
Label
(
editorContainer
,
SWT
.
RIGHT
);
lengthLabel
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
editorContainer
.
setTopRight
(
lengthLabel
,
SWT
.
FILL
);
}
int
selectedType
=
0
;
if
(
getDialogSettings
().
get
(
VALUE_TYPE_SELECTOR
)
!=
null
)
{
...
...
@@ -97,7 +99,7 @@ public class TextViewDialog extends ValueViewDialog {
if
(
readOnly
)
{
style
|=
SWT
.
READ_ONLY
;
}
textEdit
=
new
Text
(
editorContainer
,
style
);
textEdit
=
new
Text
(
useHex
?
editorContainer
:
dialogGroup
,
style
);
textEdit
.
setText
(
stringValue
);
if
(
maxSize
>
0
)
{
...
...
@@ -121,10 +123,12 @@ public class TextViewDialog extends ValueViewDialog {
}
});
CTabItem
item
=
new
CTabItem
(
editorContainer
,
SWT
.
NO_FOCUS
);
item
.
setText
(
"Text"
);
item
.
setImage
(
DBIcon
.
TYPE_TEXT
.
getImage
());
item
.
setControl
(
textEdit
);
if
(
useHex
)
{
CTabItem
item
=
new
CTabItem
(
editorContainer
,
SWT
.
NO_FOCUS
);
item
.
setText
(
"Text"
);
item
.
setImage
(
DBIcon
.
TYPE_TEXT
.
getImage
());
item
.
setControl
(
textEdit
);
}
}
Point
minSize
=
null
;
if
(
useHex
)
{
...
...
@@ -141,16 +145,16 @@ public class TextViewDialog extends ValueViewDialog {
item
.
setText
(
"Hex"
);
item
.
setImage
(
DBIcon
.
TYPE_BINARY
.
getImage
());
item
.
setControl
(
hexEditControl
);
}
if
(
selectedType
>=
editorContainer
.
getItemCount
())
{
selectedType
=
0
;
}
editorContainer
.
setSelection
(
selectedType
);
editorContainer
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
event
)
{
getDialogSettings
().
put
(
VALUE_TYPE_SELECTOR
,
editorContainer
.
getSelectionIndex
());
if
(
selectedType
>=
editorContainer
.
getItemCount
())
{
selectedType
=
0
;
}
editorContainer
.
setSelection
(
selectedType
);
editorContainer
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
event
)
{
getDialogSettings
().
put
(
VALUE_TYPE_SELECTOR
,
editorContainer
.
getSelectionIndex
());
/*
switch (editorContainer.getSelectionIndex()) {
case 0: {
...
...
@@ -162,9 +166,10 @@ public class TextViewDialog extends ValueViewDialog {
break;
}
*/
}
});
updateValueLength
();
}
});
updateValueLength
();
}
if
(
isForeignKey
)
{
super
.
createEditorSelector
(
dialogGroup
,
textEdit
);
...
...
@@ -221,22 +226,20 @@ public class TextViewDialog extends ValueViewDialog {
@Override
protected
Object
getEditorValue
()
{
switch
(
editorContainer
.
getSelectionIndex
())
{
case
0
:
return
textEdit
.
getText
();
case
1
:
System
.
out
.
println
(
getBinaryContent
());
return
getBinaryContent
();
default
:
return
null
;
if
(
editorContainer
==
null
||
editorContainer
.
getSelectionIndex
()
==
0
)
{
return
textEdit
.
getText
();
}
else
{
return
getBinaryContent
();
}
}
private
void
updateValueLength
()
{
long
maxSize
=
getValueController
().
getAttributeMetaData
().
getMaxLength
();
long
length
=
textEdit
.
getText
().
length
();
lengthLabel
.
setText
(
"Length: "
+
length
+
(
maxSize
>
0
?
" ["
+
maxSize
+
"]"
:
""
));
if
(
lengthLabel
!=
null
)
{
long
maxSize
=
getValueController
().
getAttributeMetaData
().
getMaxLength
();
long
length
=
textEdit
.
getText
().
length
();
lengthLabel
.
setText
(
"Length: "
+
length
+
(
maxSize
>
0
?
" ["
+
maxSize
+
"]"
:
""
));
}
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/ValueViewDialog.java
浏览文件 @
a1ba0624
...
...
@@ -36,11 +36,13 @@ import org.eclipse.swt.graphics.Point;
import
org.eclipse.swt.graphics.Rectangle
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.widgets.*
;
import
org.eclipse.ui.IWorkbenchPartSite
;
import
org.eclipse.ui.IWorkbenchWindow
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.core.DBeaverCore
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.data.*
;
import
org.jkiss.dbeaver.model.exec.DBCAttributeMetaData
;
...
...
@@ -110,6 +112,92 @@ public abstract class ValueViewDialog extends Dialog implements DBDValueEditorEx
return
getEnumerableConstraint
()
!=
null
;
}
protected
DBDValueEditor
createPanelEditor
(
final
Composite
placeholder
)
throws
DBException
{
return
valueController
.
getValueHandler
().
createEditor
(
new
DBDValueController
()
{
@Override
public
DBPDataSource
getDataSource
()
{
return
valueController
.
getDataSource
();
}
@Override
public
DBSAttributeBase
getAttributeMetaData
()
{
return
valueController
.
getAttributeMetaData
();
}
@Override
public
Object
getValue
()
{
return
valueController
.
getValue
();
}
@Override
public
void
updateValue
(
Object
value
)
{
valueController
.
updateValue
(
value
);
}
@Override
public
DBDValueHandler
getValueHandler
()
{
return
valueController
.
getValueHandler
();
}
@Override
public
EditType
getEditType
()
{
return
EditType
.
PANEL
;
}
@Override
public
boolean
isReadOnly
()
{
return
valueController
.
isReadOnly
();
}
@Override
public
IWorkbenchPartSite
getValueSite
()
{
return
valueController
.
getValueSite
();
}
@Override
public
Composite
getEditPlaceholder
()
{
return
placeholder
;
}
@Override
public
ToolBar
getEditToolBar
()
{
return
null
;
}
@Override
public
void
closeInlineEditor
()
{
}
@Override
public
void
nextInlineEditor
(
boolean
next
)
{
}
@Override
public
void
unregisterEditor
(
DBDValueEditorEx
editor
)
{
}
@Override
public
void
showMessage
(
String
message
,
boolean
error
)
{
}
});
}
public
DBDValueController
getValueController
()
{
return
valueController
;
}
...
...
@@ -214,6 +302,7 @@ public abstract class ValueViewDialog extends Dialog implements DBDValueEditorEx
shell
.
setSize
(
new
Point
(
Integer
.
parseInt
(
sizeString
.
substring
(
0
,
divPos
)),
Integer
.
parseInt
(
sizeString
.
substring
(
divPos
+
1
))));
shell
.
layout
();
}
Monitor
primary
=
shell
.
getMonitor
();
...
...
@@ -223,7 +312,7 @@ public abstract class ValueViewDialog extends Dialog implements DBDValueEditorEx
int
y
=
bounds
.
y
+
(
bounds
.
height
-
rect
.
height
)
/
3
;
x
+=
dialogCount
*
20
;
y
+=
dialogCount
*
20
;
shell
.
setLocation
(
x
,
y
);
shell
.
setLocation
(
x
,
y
);
}
private
String
getInfoVisiblePrefId
()
...
...
@@ -303,6 +392,12 @@ public abstract class ValueViewDialog extends Dialog implements DBDValueEditorEx
protected
abstract
Object
getEditorValue
();
@Override
public
Control
getControl
()
{
return
editor
;
}
@Override
public
Object
extractValue
(
DBRProgressMonitor
monitor
)
throws
DBException
{
...
...
@@ -401,11 +496,7 @@ public abstract class ValueViewDialog extends Dialog implements DBDValueEditorEx
if
(
selection
!=
null
&&
selection
.
length
>
0
)
{
handleEditorChange
=
false
;
Object
value
=
selection
[
0
].
getData
();
if
(
value
instanceof
Number
)
{
editor
.
setText
(
value
.
toString
());
}
else
{
editor
.
setText
(
selection
[
0
].
getText
());
}
editor
.
setText
(
selection
[
0
].
getText
());
handleEditorChange
=
true
;
}
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/content/ContentEditor.java
浏览文件 @
a1ba0624
...
...
@@ -30,6 +30,7 @@ import org.eclipse.swt.SWT;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Control
;
import
org.eclipse.ui.*
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.ext.IContentEditorPart
;
...
...
@@ -442,6 +443,12 @@ public class ContentEditor extends MultiPageAbstractEditor implements IDataSourc
return
input
==
null
?
null
:
input
.
getValueController
();
}
@Override
public
Control
getControl
()
{
return
getControl
(
getActivePage
());
}
@Override
public
Object
extractValue
(
DBRProgressMonitor
monitor
)
throws
DBException
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
浏览文件 @
a1ba0624
...
...
@@ -804,7 +804,7 @@ public class SQLEditor extends SQLEditorBase
@Override
public
int
getSupportedFeatures
()
{
return
0
;
return
DATA_SELECT
;
}
@Override
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/perspective/DataSourceManagementToolbar.java
浏览文件 @
a1ba0624
...
...
@@ -787,7 +787,7 @@ public class DataSourceManagementToolbar implements DBPRegistryListener, DBPEven
}
//resultSetSize.setDigits(7);
resultSetSize
.
setLayoutData
(
gd
);
resultSetSize
.
addVerifyListener
(
UIUtils
.
INTEGER_VERIFY_LISTENER
);
resultSetSize
.
addVerifyListener
(
UIUtils
.
getIntegerVerifyListener
()
);
resultSetSize
.
addFocusListener
(
new
FocusListener
()
{
@Override
public
void
focusGained
(
FocusEvent
e
)
...
...
plugins/org.jkiss.dbeaver.mysql/src/org/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
浏览文件 @
a1ba0624
...
...
@@ -134,7 +134,7 @@ public class MySQLConnectionPage extends ConnectionPageAdvanced
gd
=
new
GridData
(
GridData
.
VERTICAL_ALIGN_BEGINNING
);
gd
.
widthHint
=
40
;
portText
.
setLayoutData
(
gd
);
portText
.
addVerifyListener
(
UIUtils
.
INTEGER_VERIFY_LISTENER
);
portText
.
addVerifyListener
(
UIUtils
.
getIntegerVerifyListener
()
);
portText
.
addModifyListener
(
textListener
);
Label
dbLabel
=
UIUtils
.
createControlLabel
(
addrGroup
,
MySQLMessages
.
dialog_connection_database
);
...
...
plugins/org.jkiss.dbeaver.oracle/src/org/jkiss/dbeaver/ext/oracle/views/OracleConnectionPage.java
浏览文件 @
a1ba0624
...
...
@@ -196,7 +196,7 @@ public class OracleConnectionPage extends ConnectionPageAdvanced
gd
=
new
GridData
(
GridData
.
VERTICAL_ALIGN_BEGINNING
);
gd
.
widthHint
=
40
;
portText
.
setLayoutData
(
gd
);
portText
.
addVerifyListener
(
UIUtils
.
INTEGER_VERIFY_LISTENER
);
portText
.
addVerifyListener
(
UIUtils
.
getIntegerVerifyListener
()
);
portText
.
addModifyListener
(
controlModifyListener
);
UIUtils
.
createControlLabel
(
targetContainer
,
OracleMessages
.
dialog_connection_database
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录