use of org.pentaho.di.ui.spoon.DatabasesCollector in project pentaho-kettle by pentaho.
the class DBConnectionFolderProvider method refresh.
@Override
public void refresh(AbstractMeta meta, TreeNode treeNode, String filter) {
DatabasesCollector collector = new DatabasesCollector(meta, spoon.getRepository());
try {
try {
collector.collectDatabases();
} catch (KettleException e) {
if (e.getCause() instanceof KettleRepositoryLostException) {
Spoon.getInstance().handleRepositoryLost((KettleRepositoryLostException) e.getCause());
collector = new DatabasesCollector(meta, null);
collector.collectDatabases();
} else {
throw e;
}
}
} catch (KettleException e) {
new ErrorDialog(Spoon.getInstance().getShell(), BaseMessages.getString(PKG, "Spoon.ErrorDialog.Title"), BaseMessages.getString(PKG, "Spoon.ErrorDialog.ErrorFetchingFromRepo.DbConnections"), e);
}
for (String dbName : collector.getDatabaseNames()) {
if (!filterMatch(dbName, filter)) {
continue;
}
DatabaseMeta databaseMeta = collector.getMetaFor(dbName);
TreeNode childTreeNode = createTreeNode(treeNode, databaseMeta.getDisplayName(), guiResource.getImageConnectionTree());
if (databaseMeta.isShared()) {
childTreeNode.setFont(guiResource.getFontBold());
}
}
}
Aggregations