Object (@NotNull String dataId) { if (CommonDataKeys.NAVIGATABLE.is(dataId)) { final TreePath path = myTree.getSelectionPath(); if (path != null) { final Object usrObject = ((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject(); if (usrObject instanceof VirtualFile) { return new OpenFileDescriptor(myProject, (VirtualFile)usrObject); } else if (usrObject instanceof NavigatablePsiElement) { return usrObject; } } } return null; }