Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
ac338324
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,发现更多精彩内容 >>
提交
ac338324
编写于
9月 10, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Driver settings panel.
Provided datasources save fix Former-commit-id:
a8657014
上级
b301fce8
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
95 addition
and
55 deletion
+95
-55
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/CoreMessages.java
...dbeaver.core/src/org/jkiss/dbeaver/core/CoreMessages.java
+3
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/CoreResources.properties
....core/src/org/jkiss/dbeaver/core/CoreResources.properties
+3
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/CoreResources_ru.properties
...re/src/org/jkiss/dbeaver/core/CoreResources_ru.properties
+4
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
.../src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
+10
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
...re/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
+13
-5
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionPageAbstract.java
...dbeaver/ui/dialogs/connection/ConnectionPageAbstract.java
+55
-0
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericMessages.java
...ic/src/org/jkiss/dbeaver/ext/generic/GenericMessages.java
+0
-2
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericResources.properties
...org/jkiss/dbeaver/ext/generic/GenericResources.properties
+0
-2
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericResources_it.properties
.../jkiss/dbeaver/ext/generic/GenericResources_it.properties
+0
-1
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericResources_ru.properties
.../jkiss/dbeaver/ext/generic/GenericResources_ru.properties
+0
-2
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericResources_zh.properties
.../jkiss/dbeaver/ext/generic/GenericResources_zh.properties
+0
-1
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/views/GenericConnectionPage.java
...kiss/dbeaver/ext/generic/views/GenericConnectionPage.java
+7
-41
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/CoreMessages.java
浏览文件 @
ac338324
...
...
@@ -1359,8 +1359,10 @@ public class CoreMessages extends NLS {
public
static
String
ui_properties_tree_viewer_action_reset_value
;
public
static
String
ui_properties_tree_viewer_category_general
;
public
static
String
ui_properties_value
;
public
static
String
dialog_connection_edit_driver_button
;
public
static
String
dialog_connection_driver
;
static
{
static
{
// initialize resource bundle
NLS
.
initializeMessages
(
BUNDLE_NAME
,
CoreMessages
.
class
);
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/CoreResources.properties
浏览文件 @
ac338324
...
...
@@ -911,3 +911,6 @@ ui_properties_tree_viewer__to_default=\ to default
ui_properties_tree_viewer_action_copy_value
=
Copy value
ui_properties_tree_viewer_action_reset_value
=
Reset value
ui_properties_tree_viewer_category_general
=
General
dialog_connection_driver
=
Driver Name:
dialog_connection_edit_driver_button
=
Edit Driver Settings
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/core/CoreResources_ru.properties
浏览文件 @
ac338324
...
...
@@ -468,3 +468,7 @@ editor_binary_hex_status_line_selection=\u0412\u044B\u0434\u0435\u043B\u0435\u04
editor_binary_hex_status_line_text_insert=
\u0412\u0441\u0442\u0430\u0432\u
043A
\u0430
editor_binary_hex_status_line_text_ovewrite=
\u0417\u0430\u
043C
\u0435\u0449\u0435\u
043D
\u0438\u0435
editor_binary_hex_status_line_value=
\u0417\u
043D
\u0430\u0447\u0435\u
043D
\u0438\u0435\:
dialog_connection_driver=
\u0414\u0440\u0430\u0439\u0432\u0435\u0440
:
dialog_connection_edit_driver_button
=
\u
041D
\u0430\u0441\u0442\u0440\u
043E
\u0439\u
043A
\u0438
\u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
浏览文件 @
ac338324
...
...
@@ -127,6 +127,8 @@ public class DataSourceDescriptor
private
final
List
<
DBPDataSourceUser
>
users
=
new
ArrayList
<
DBPDataSourceUser
>();
private
boolean
provided
;
private
volatile
boolean
connectFailed
=
false
;
private
volatile
Date
connectTime
=
null
;
private
volatile
boolean
disposed
=
false
;
...
...
@@ -438,6 +440,14 @@ public class DataSourceDescriptor
return
clientHome
;
}
public
boolean
isProvided
()
{
return
provided
;
}
public
void
setProvided
(
boolean
provided
)
{
this
.
provided
=
provided
;
}
@Override
public
DBSObject
getParentObject
()
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
浏览文件 @
ac338324
...
...
@@ -310,11 +310,12 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
if
(!
fromFile
.
exists
())
{
return
;
}
boolean
extraConfig
=
!
fromFile
.
getName
().
equalsIgnoreCase
(
CONFIG_FILE_NAME
);
try
{
InputStream
is
=
new
FileInputStream
(
fromFile
);
try
{
try
{
loadDataSources
(
is
,
encrypter
);
loadDataSources
(
is
,
e
xtraConfig
,
e
ncrypter
);
}
catch
(
DBException
ex
)
{
log
.
warn
(
"Error loading datasource config from "
+
fromFile
.
getAbsolutePath
(),
ex
);
}
...
...
@@ -333,12 +334,12 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
}
}
private
void
loadDataSources
(
InputStream
is
,
PasswordEncrypter
encrypter
)
private
void
loadDataSources
(
InputStream
is
,
boolean
extraConfig
,
PasswordEncrypter
encrypter
)
throws
DBException
,
IOException
{
SAXReader
parser
=
new
SAXReader
(
is
);
try
{
parser
.
parse
(
new
DataSourcesParser
(
encrypter
));
parser
.
parse
(
new
DataSourcesParser
(
e
xtraConfig
,
e
ncrypter
));
}
catch
(
XMLException
ex
)
{
throw
new
DBException
(
"Datasource config parse error"
,
ex
);
...
...
@@ -365,7 +366,9 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
xml
.
setButify
(
true
);
xml
.
startElement
(
"data-sources"
);
for
(
DataSourceDescriptor
dataSource
:
localDataSources
)
{
saveDataSource
(
xml
,
dataSource
,
encrypter
);
if
(!
dataSource
.
isProvided
())
{
saveDataSource
(
xml
,
dataSource
,
encrypter
);
}
}
xml
.
endElement
();
xml
.
flush
();
...
...
@@ -603,6 +606,7 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
private
class
DataSourcesParser
implements
SAXListener
{
DataSourceDescriptor
curDataSource
;
boolean
extraConfig
;
PasswordEncrypter
encrypter
;
boolean
isDescription
=
false
;
DBRShellCommand
curCommand
=
null
;
...
...
@@ -610,8 +614,9 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
private
DBSObjectFilter
curFilter
;
private
StringBuilder
curQuery
;
private
DataSourcesParser
(
PasswordEncrypter
encrypter
)
private
DataSourcesParser
(
boolean
extraConfig
,
PasswordEncrypter
encrypter
)
{
this
.
extraConfig
=
extraConfig
;
this
.
encrypter
=
encrypter
;
}
...
...
@@ -648,6 +653,9 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
id
,
driver
,
new
DBPConnectionConfiguration
());
if
(
extraConfig
)
{
curDataSource
.
setProvided
(
true
);
}
curDataSource
.
setName
(
name
);
String
createDate
=
atts
.
getValue
(
RegistryConstants
.
ATTR_CREATE_DATE
);
if
(!
CommonUtils
.
isEmpty
(
createDate
))
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/ConnectionPageAbstract.java
浏览文件 @
ac338324
...
...
@@ -18,8 +18,18 @@
package
org.jkiss.dbeaver.ui.dialogs.connection
;
import
org.eclipse.jface.dialogs.DialogPage
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.events.SelectionListener
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.widgets.Button
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Label
;
import
org.eclipse.swt.widgets.Text
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.core.CoreMessages
;
import
org.jkiss.dbeaver.model.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.model.DBPDriver
;
import
org.jkiss.dbeaver.model.struct.DBSDataSourceContainer
;
import
org.jkiss.dbeaver.ui.IDataSourceConnectionEditor
;
import
org.jkiss.dbeaver.ui.IDataSourceConnectionEditorSite
;
...
...
@@ -30,6 +40,8 @@ import org.jkiss.dbeaver.ui.IDataSourceConnectionEditorSite;
public
abstract
class
ConnectionPageAbstract
extends
DialogPage
implements
IDataSourceConnectionEditor
{
protected
IDataSourceConnectionEditorSite
site
;
// Driver name
protected
Text
driverText
;
public
IDataSourceConnectionEditorSite
getSite
()
{
return
site
;
...
...
@@ -71,4 +83,47 @@ public abstract class ConnectionPageAbstract extends DialogPage implements IData
}
}
protected
void
createDriverPanel
(
Composite
parent
)
{
Label
divLabel
=
new
Label
(
parent
,
SWT
.
SEPARATOR
|
SWT
.
HORIZONTAL
);
GridData
gd
=
new
GridData
(
GridData
.
FILL_HORIZONTAL
);
gd
.
horizontalSpan
=
4
;
divLabel
.
setLayoutData
(
gd
);
Label
driverLabel
=
new
Label
(
parent
,
SWT
.
NONE
);
driverLabel
.
setText
(
CoreMessages
.
dialog_connection_driver
);
gd
=
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
);
driverLabel
.
setLayoutData
(
gd
);
driverText
=
new
Text
(
parent
,
SWT
.
READ_ONLY
);
gd
=
new
GridData
(
GridData
.
FILL_HORIZONTAL
);
gd
.
horizontalSpan
=
2
;
gd
.
grabExcessHorizontalSpace
=
true
;
//gd.widthHint = 200;
driverText
.
setLayoutData
(
gd
);
Button
driverButton
=
new
Button
(
parent
,
SWT
.
PUSH
);
driverButton
.
setText
(
CoreMessages
.
dialog_connection_edit_driver_button
);
gd
=
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
);
driverButton
.
setLayoutData
(
gd
);
driverButton
.
addSelectionListener
(
new
SelectionListener
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
if
(
site
.
openDriverEditor
())
{
updateDriverInfo
(
site
.
getDriver
());
}
}
@Override
public
void
widgetDefaultSelected
(
SelectionEvent
e
)
{
}
});
}
protected
void
updateDriverInfo
(
DBPDriver
driver
)
{
}
}
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericMessages.java
浏览文件 @
ac338324
...
...
@@ -36,14 +36,12 @@ public class GenericMessages extends NLS {
public
static
String
dialog_connection_db_folder_chooser_text
;
public
static
String
dialog_connection_edit_driver_button
;
public
static
String
dialog_connection_general_tab
;
public
static
String
dialog_connection_general_tab_tooltip
;
public
static
String
dialog_connection_host_label
;
public
static
String
dialog_connection_driver
;
public
static
String
dialog_connection_jdbc_url_
;
public
static
String
dialog_connection_password_label
;
...
...
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericResources.properties
浏览文件 @
ac338324
...
...
@@ -22,11 +22,9 @@ dialog_connection_database_schema_label=Database/Schema:
dialog_connection_db_file_chooser_text
=
Choose database file
dialog_connection_db_folder_chooser_message
=
Choose folder with database files
dialog_connection_db_folder_chooser_text
=
Choose database folder
dialog_connection_edit_driver_button
=
Edit Driver Settings
dialog_connection_general_tab
=
General
dialog_connection_general_tab_tooltip
=
General connection properties
dialog_connection_host_label
=
Host:
dialog_connection_driver
=
Driver Name:
dialog_connection_jdbc_url_
=
JDBC URL:
dialog_connection_password_label
=
Password:
dialog_connection_path_label
=
Path:
...
...
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericResources_it.properties
浏览文件 @
ac338324
...
...
@@ -20,7 +20,6 @@ dialog_connection_database_schema_label = Database/Schema\:
dialog_connection_db_file_chooser_text
=
Scegli file database
dialog_connection_db_folder_chooser_message
=
Scegli cartella con file database
dialog_connection_db_folder_chooser_text
=
Scegli cartella database
dialog_connection_edit_driver_button
=
Modifica Impostazioni Driver
dialog_connection_general_tab
=
Generale
dialog_connection_general_tab_tooltip
=
Propriet
\u
00E0 generali connessione
dialog_connection_host_label
=
Host
\:
...
...
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericResources_ru.properties
浏览文件 @
ac338324
...
...
@@ -22,11 +22,9 @@ dialog_connection_database_schema_label=\u0411\u0414/\u0421\u0445\u0435\u043C\u0
dialog_connection_db_file_chooser_text
=
\u0412\u
044B
\u0431\u0435\u0440\u0438\u0442\u0435
\u0444\u0430\u0439\u
043B
\u0411\u0414
dialog_connection_db_folder_chooser_message=
\u0412\u
044B
\u0431\u0435\u0440\u0438\u0442\u0435
\u
043F
\u0430\u
043F
\u
043A
\u0443
\u0441
\u0444\u0430\u0439\u
043B
\u0430\u
043C
\u0438
\u0411\u0414
dialog_connection_db_folder_chooser_text=
\u0412\u
044B
\u0431\u0435\u0440\u0438\u0442\u0435
\u
043F
\u0430\u
043F
\u
043A
\u0443
\u0411\u0414
dialog_connection_edit_driver_button=
\u
041D
\u0430\u0441\u0442\u0440\u
043E
\u0439\u
043A
\u0438
\u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430
dialog_connection_general_tab=
\u
041E
\u0431\u0449\u0438\u0435
dialog_connection_general_tab_tooltip=
\u
041E
\u0431\u0449\u0438\u0435
\u0441\u0432\u
043E
\u0439\u0441\u0442\u0432\u0430
\u0441\u
043E
\u0435\u0434\u0438\u
043D
\u0435\u
043D
\u0438\u
044F
dialog_connection_host_label
=
\u0421\u0435\u0440\u0432\u0435\u0440
:
dialog_connection_driver
=
\u0414\u0440\u0430\u0439\u0432\u0435\u0440
:
dialog_connection_jdbc_url_
=
JDBC URL:
dialog_connection_password_label
=
\u
041F
\u0430\u0440\u
043E
\u
043B
\u
044C:
dialog_connection_path_label
=
\u
041F
\u0443\u0442\u
044C:
...
...
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/GenericResources_zh.properties
浏览文件 @
ac338324
...
...
@@ -20,7 +20,6 @@ dialog_connection_database_schema_label = \u6570\u636E\u5E93/\u6A21\u5F0F\:
dialog_connection_db_file_chooser_text
=
\u9009\u
62E9
\u6570\u
636E
\u
5E93
\u6587\u
4EF6
dialog_connection_db_folder_chooser_message
=
\u9009\u
62E9
\u6570\u
636E
\u
5E93
\u6240\u5728\u6587\u
4EF6
\u5939
dialog_connection_db_folder_chooser_text
=
\u9009\u
62E9
\u6570\u
636E
\u
5E93
\u6587\u
4EF6
\u5939
dialog_connection_edit_driver_button
=
\u
7F16
\u
8F91
\u
9A71
\u
52A8
\u
5C5E
\u6027
dialog_connection_general_tab
=
\u
4E00
\u
822C
dialog_connection_general_tab_tooltip
=
\u
4E00
\u
822C
\u
8FDE
\u
63A5
\u
5C5E
\u6027
dialog_connection_host_label
=
\u
4E3B
\u
673A
\:
...
...
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/views/GenericConnectionPage.java
浏览文件 @
ac338324
...
...
@@ -44,8 +44,6 @@ import java.util.List;
*/
public
class
GenericConnectionPage
extends
ConnectionPageAbstract
implements
ICompositeDialogPage
{
// Driver name
private
Text
driverText
;
// Host/port
private
Text
hostText
;
private
Text
portText
;
...
...
@@ -279,45 +277,7 @@ public class GenericConnectionPage extends ConnectionPageAbstract implements ICo
gd
.
grabExcessVerticalSpace
=
true
;
placeholder
.
setLayoutData
(
gd
);
Label
divLabel
=
new
Label
(
settingsGroup
,
SWT
.
SEPARATOR
|
SWT
.
HORIZONTAL
);
gd
=
new
GridData
(
GridData
.
FILL_HORIZONTAL
);
gd
.
horizontalSpan
=
4
;
divLabel
.
setLayoutData
(
gd
);
{
Label
driverLabel
=
new
Label
(
settingsGroup
,
SWT
.
NONE
);
driverLabel
.
setText
(
GenericMessages
.
dialog_connection_driver
);
gd
=
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
);
driverLabel
.
setLayoutData
(
gd
);
driverText
=
new
Text
(
settingsGroup
,
SWT
.
READ_ONLY
);
gd
=
new
GridData
(
GridData
.
FILL_HORIZONTAL
);
gd
.
horizontalSpan
=
2
;
gd
.
grabExcessHorizontalSpace
=
true
;
//gd.widthHint = 200;
driverText
.
setLayoutData
(
gd
);
Button
driverButton
=
new
Button
(
settingsGroup
,
SWT
.
PUSH
);
driverButton
.
setText
(
GenericMessages
.
dialog_connection_edit_driver_button
);
gd
=
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
);
driverButton
.
setLayoutData
(
gd
);
driverButton
.
addSelectionListener
(
new
SelectionListener
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
if
(
site
.
openDriverEditor
())
{
parseSampleURL
(
site
.
getDriver
());
saveAndUpdate
();
}
}
@Override
public
void
widgetDefaultSelected
(
SelectionEvent
e
)
{
}
});
}
createDriverPanel
(
settingsGroup
);
setControl
(
settingsGroup
);
}
...
...
@@ -332,6 +292,12 @@ public class GenericConnectionPage extends ConnectionPageAbstract implements ICo
return
emptyLabel
;
}
@Override
protected
void
updateDriverInfo
(
DBPDriver
driver
)
{
parseSampleURL
(
driver
);
saveAndUpdate
();
}
@Override
public
boolean
isComplete
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录