提交 3c2610de 编写于 作者: S Serge Rider

Datasiure copy enhanement (headless mode)


Former-commit-id: 8da034a1
上级 fa0e518e
......@@ -80,7 +80,7 @@ public interface DBPDataSourceRegistry extends DBPObject {
void removeFolder(DBPDataSourceFolder folder, boolean dropContents);
DBPDataSourceRegistry createCopy(IProject project);
DBPDataSourceRegistry createCopy(IProject project, boolean copyDataSources);
@Nullable
DBSObjectFilter getSavedFilter(String name);
......
......@@ -47,7 +47,7 @@ public class DBNProjectDatabases extends DBNNode implements DBNContainer, DBPEve
super(parentNode);
this.dataSourceRegistry = getModel().isGlobal() ?
dataSourceRegistry :
dataSourceRegistry.createCopy(parentNode.getProject());
dataSourceRegistry.createCopy(parentNode.getProject(), false);
this.dataSourceRegistry.addDataSourceListener(this);
List<? extends DBPDataSourceContainer> projectDataSources = this.dataSourceRegistry.getDataSources();
......
......@@ -102,11 +102,13 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
/**
* Create copy
*/
public DataSourceRegistry(DataSourceRegistry source, IProject project) {
public DataSourceRegistry(DataSourceRegistry source, IProject project, boolean copyDataSources) {
this.platform = source.platform;
this.project = project;
for (DataSourceDescriptor ds : source.dataSources) {
dataSources.add(new DataSourceDescriptor(ds, this));
if (copyDataSources) {
for (DataSourceDescriptor ds : source.dataSources) {
dataSources.add(new DataSourceDescriptor(ds, this));
}
}
}
......@@ -292,8 +294,8 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
}
@Override
public DBPDataSourceRegistry createCopy(IProject project) {
return new DataSourceRegistry(this, project);
public DBPDataSourceRegistry createCopy(IProject project, boolean copyDataSources) {
return new DataSourceRegistry(this, project, copyDataSources);
}
private DataSourceFolder findRootFolder(String name) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册