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

#5339 DB navigator: resources opening fix. Resources icons fix

上级 4e5c8722
......@@ -16,6 +16,7 @@
*/
package org.jkiss.dbeaver.ui.editors.entity;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.Separator;
......@@ -212,7 +213,7 @@ public class FolderEditor extends EditorPart implements INavigatorModelView, IRe
@Override
protected void openNodeEditor(DBNNode node) {
final DBNNode rootNode = getRootNode();
if (!(node instanceof DBNDatabaseNode)) {
if (!canOpenNode(node)) {
if (node instanceof DBNRoot) {
if (rootNode instanceof DBNLocalFolder) {
node = ((DBNLocalFolder) rootNode).getLogicalParent();
......@@ -261,4 +262,9 @@ public class FolderEditor extends EditorPart implements INavigatorModelView, IRe
}
}
private boolean canOpenNode(DBNNode node) {
return node instanceof DBNDatabaseNode ||
(node instanceof DBNResource && ((DBNResource) node).getResource() instanceof IFile);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册