提交 45998281 编写于 作者: S serge-rider

#5867 NAvigator tree: child nodes reading fix

上级 41bf2ce5
......@@ -133,7 +133,7 @@ public class DBNProjectDatabases extends DBNNode implements DBNContainer, DBPEve
@Override
public boolean allowsChildren()
{
return !dataSources.isEmpty();
return !dataSources.isEmpty() || !dataSourceRegistry.getRootFolders().isEmpty();
}
@Override
......
......@@ -65,7 +65,7 @@ public class DBXTreeFolder extends DBXTreeNode {
}
@Override
public String getNodeType(@NotNull DBPDataSource dataSource, @Nullable String locale) {
public String getNodeType(@Nullable DBPDataSource dataSource, @Nullable String locale) {
if (locale == null) {
return label;
} else {
......@@ -74,7 +74,7 @@ public class DBXTreeFolder extends DBXTreeNode {
}
@Override
public String getChildrenType(DBPDataSource dataSource, String locale) {
public String getChildrenType(@Nullable DBPDataSource dataSource, String locale) {
return getNodeType(dataSource, locale);
}
......
......@@ -86,7 +86,7 @@ public class DBXTreeItem extends DBXTreeNode
}
@Override
public String getChildrenType(DBPDataSource dataSource, String locale)
public String getChildrenType(@Nullable DBPDataSource dataSource, String locale)
{
final String term = getNodeTerm(dataSource, label, true);
if (term != null) {
......@@ -96,7 +96,7 @@ public class DBXTreeItem extends DBXTreeNode
}
@Override
public String getNodeType(@NotNull DBPDataSource dataSource, @Nullable String locale)
public String getNodeType(@Nullable DBPDataSource dataSource, @Nullable String locale)
{
final String term = getNodeTerm(dataSource, itemLabel, false);
if (term != null) {
......@@ -105,7 +105,7 @@ public class DBXTreeItem extends DBXTreeNode
return itemLabel;
}
private String getNodeTerm(DBPDataSource dataSource, String termId, boolean multiple)
private String getNodeTerm(@Nullable DBPDataSource dataSource, String termId, boolean multiple)
{
if (termId.startsWith("#") && dataSource instanceof DBPTermProvider) {
final String term = ((DBPTermProvider) dataSource).getObjectTypeTerm(getPath(), termId.substring(1), multiple);
......
......@@ -142,12 +142,12 @@ public abstract class DBXTreeNode
/**
* Human readable node type
*/
public abstract String getNodeType(@NotNull DBPDataSource dataSource, @Nullable String locale);
public abstract String getNodeType(@Nullable DBPDataSource dataSource, @Nullable String locale);
/**
* Human readable child nodes type
*/
public abstract String getChildrenType(@NotNull DBPDataSource dataSource, @Nullable String locale);
public abstract String getChildrenType(@Nullable DBPDataSource dataSource, @Nullable String locale);
public boolean isNavigable()
{
......
......@@ -52,13 +52,13 @@ public class DBXTreeObject extends DBXTreeNode
}
@Override
public String getNodeType(@NotNull DBPDataSource dataSource, @Nullable String locale)
public String getNodeType(@Nullable DBPDataSource dataSource, @Nullable String locale)
{
return label;
}
@Override
public String getChildrenType(DBPDataSource dataSource, String locale)
public String getChildrenType(@Nullable DBPDataSource dataSource, String locale)
{
return label;
}
......
......@@ -92,12 +92,7 @@ public class NavigatorHandlerLocalFolderCreate extends AbstractHandler {
if (parentFolder != null && activePart instanceof NavigatorViewBase) {
final TreeViewer viewer = ((NavigatorViewBase) activePart).getNavigatorViewer();
if (viewer != null) {
UIUtils.asyncExec(new Runnable() {
@Override
public void run() {
viewer.expandToLevel(parentFolder, 1);
}
});
UIUtils.asyncExec(() -> viewer.expandToLevel(parentFolder, 1));
}
}
DBNModel.updateConfigAndRefreshDatabases(databases);
......
......@@ -67,6 +67,7 @@ public class DatabaseNavigatorView extends NavigatorViewBase implements DBPProje
{
UIUtils.asyncExec(() -> {
getNavigatorTree().getViewer().setInput(new DatabaseNavigatorContent(getRootNode()));
getSite().getSelectionProvider().setSelection(getNavigatorTree().getViewer().getSelection());
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册