Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
04ac5407
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,发现更多精彩内容 >>
提交
04ac5407
编写于
6月 28, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Data transfer wizard fix - use lazy target node resolution
上级
14c740ad
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
32 deletion
+42
-32
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseConsumerPageMapping.java
.../tools/transfer/database/DatabaseConsumerPageMapping.java
+13
-7
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseConsumerSettings.java
...ver/tools/transfer/database/DatabaseConsumerSettings.java
+29
-25
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseConsumerPageMapping.java
浏览文件 @
04ac5407
...
...
@@ -64,6 +64,8 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
public
static
final
String
TARGET_NAME_BROWSE
=
"[browse]"
;
private
TreeViewer
mappingViewer
;
private
Label
containerIcon
;
private
Text
containerName
;
private
static
abstract
class
MappingLabelProvider
extends
CellLabelProvider
{
@Override
...
...
@@ -99,14 +101,12 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
containerPanel
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
UIUtils
.
createControlLabel
(
containerPanel
,
"Target container"
);
DBNDatabaseNode
containerNode
=
settings
.
getContainerNode
();
final
Label
containerIcon
=
new
Label
(
containerPanel
,
SWT
.
NONE
);
containerIcon
=
new
Label
(
containerPanel
,
SWT
.
NONE
);
containerIcon
.
setImage
(
DBeaverIcons
.
getImage
(
DBIcon
.
TYPE_UNKNOWN
));
if
(
containerNode
!=
null
)
containerIcon
.
setImage
(
DBeaverIcons
.
getImage
(
containerNode
.
getNodeIconDefault
()));
final
Text
containerName
=
new
Text
(
containerPanel
,
SWT
.
BORDER
|
SWT
.
READ_ONLY
);
containerName
=
new
Text
(
containerPanel
,
SWT
.
BORDER
|
SWT
.
READ_ONLY
);
containerName
.
setLayoutData
(
new
GridData
(
GridData
.
FILL_HORIZONTAL
));
if
(
containerNode
!=
null
)
containerName
.
setText
(
settings
.
getContainerFullName
()
);
containerName
.
setText
(
""
);
Button
browseButton
=
new
Button
(
containerPanel
,
SWT
.
PUSH
);
browseButton
.
setImage
(
DBeaverIcons
.
getImage
(
DBIcon
.
TREE_FOLDER
));
...
...
@@ -595,9 +595,15 @@ public class DatabaseConsumerPageMapping extends ActiveWizardPage<DataTransferWi
@Override
public
void
activatePage
()
{
if
(
mappingViewer
.
getInput
()
==
null
)
{
final
DatabaseConsumerSettings
settings
=
getWizard
().
getPageSettings
(
this
,
DatabaseConsumerSettings
.
class
);
final
DatabaseConsumerSettings
settings
=
getWizard
().
getPageSettings
(
this
,
DatabaseConsumerSettings
.
class
);
settings
.
loadNode
();
DBNDatabaseNode
containerNode
=
settings
.
getContainerNode
();
if
(
containerNode
!=
null
)
{
containerIcon
.
setImage
(
DBeaverIcons
.
getImage
(
containerNode
.
getNodeIconDefault
()));
containerName
.
setText
(
containerNode
.
getNodeFullName
());
}
if
(
mappingViewer
.
getInput
()
==
null
)
{
Map
<
DBSDataContainer
,
DatabaseMappingContainer
>
dataMappings
=
settings
.
getDataMappings
();
for
(
DataTransferPipe
pipe
:
getWizard
().
getSettings
().
getDataPipes
())
{
if
(
pipe
.
getProducer
()
==
null
)
{
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseConsumerSettings.java
浏览文件 @
04ac5407
...
...
@@ -18,6 +18,7 @@
package
org.jkiss.dbeaver.tools.transfer.database
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.core.DBeaverUI
;
import
org.jkiss.dbeaver.core.Log
;
import
org.eclipse.jface.dialogs.IDialogSettings
;
import
org.eclipse.jface.operation.IRunnableContext
;
...
...
@@ -49,6 +50,7 @@ public class DatabaseConsumerSettings implements IDataTransferSettings {
static
final
Log
log
=
Log
.
getLog
(
DatabaseConsumerSettings
.
class
);
private
String
containerNodePath
;
private
DBNDatabaseNode
containerNode
;
private
Map
<
DBSDataContainer
,
DatabaseMappingContainer
>
dataMappings
=
new
LinkedHashMap
<
DBSDataContainer
,
DatabaseMappingContainer
>();
private
boolean
openNewConnections
=
true
;
...
...
@@ -162,31 +164,7 @@ public class DatabaseConsumerSettings implements IDataTransferSettings {
@Override
public
void
loadSettings
(
IRunnableContext
runnableContext
,
IDialogSettings
dialogSettings
)
{
final
String
containerPath
=
dialogSettings
.
get
(
"container"
);
if
(!
CommonUtils
.
isEmpty
(
containerPath
))
{
try
{
RuntimeUtils
.
run
(
runnableContext
,
true
,
true
,
new
DBRRunnableWithProgress
()
{
@Override
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
try
{
DBNNode
node
=
DBeaverCore
.
getInstance
().
getNavigatorModel
().
getNodeByPath
(
monitor
,
containerPath
);
if
(
node
instanceof
DBNDatabaseNode
)
{
containerNode
=
(
DBNDatabaseNode
)
node
;
}
}
catch
(
DBException
e
)
{
throw
new
InvocationTargetException
(
e
);
}
}
});
}
catch
(
InvocationTargetException
e
)
{
log
.
error
(
"Error getting container node"
,
e
.
getTargetException
());
}
catch
(
InterruptedException
e
)
{
// skip
}
}
containerNodePath
=
dialogSettings
.
get
(
"container"
);
if
(
dialogSettings
.
get
(
"openNewConnections"
)
!=
null
)
{
openNewConnections
=
dialogSettings
.
getBoolean
(
"openNewConnections"
);
}
...
...
@@ -223,4 +201,30 @@ public class DatabaseConsumerSettings implements IDataTransferSettings {
DBUtils
.
getObjectFullName
(
container
)
+
" ["
+
container
.
getDataSource
().
getContainer
().
getName
()
+
"]"
;
}
public
void
loadNode
()
{
if
(
containerNode
==
null
&&
!
CommonUtils
.
isEmpty
(
containerNodePath
))
{
if
(!
CommonUtils
.
isEmpty
(
containerNodePath
))
{
try
{
DBeaverUI
.
runInProgressDialog
(
new
DBRRunnableWithProgress
()
{
@Override
public
void
run
(
DBRProgressMonitor
monitor
)
throws
InvocationTargetException
,
InterruptedException
{
try
{
DBNNode
node
=
DBeaverCore
.
getInstance
().
getNavigatorModel
().
getNodeByPath
(
monitor
,
containerNodePath
);
if
(
node
instanceof
DBNDatabaseNode
)
{
containerNode
=
(
DBNDatabaseNode
)
node
;
}
}
catch
(
DBException
e
)
{
throw
new
InvocationTargetException
(
e
);
}
}
});
}
catch
(
InvocationTargetException
e
)
{
log
.
error
(
"Error getting container node"
,
e
.
getTargetException
());
}
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录