@SuppressWarnings({"unchecked"})
final AbstractTreeNode<VisitableTreeNode> treeNode = (AbstractTreeNode<VisitableTreeNode>) treepath.getLastPathComponent();
if (!(treeNode instanceof BugInstanceNode)) {
return null;
}
final BugInstanceNode node = (BugInstanceNode) treeNode;
if ("virtualFile".equals(s)) {
final PsiFile psiFile = _treeHelper.getSelectedFile();
return psiFile == null ? null : psiFile.getVirtualFile();
}
if ("Navigatable".equals(s)) {
final PsiFile psiFile = _treeHelper.getSelectedFile();
if (psiFile != null) {
final VirtualFile virtualFile = psiFile.getVirtualFile();
//LOGGER.debug("PsiFile: " + psiFile + " VirtualFile: " + virtualFile.getName() + " - Line: " + node.getSourceLines()[0]);
final int[] lines = node.getSourceLines();
if (lines[0] == -1 && lines[1] == -1) { // find anonymous classes
final PsiElement psiElement = IdeaUtilImpl.findAnonymousClassPsiElement(psiFile, node, _project);
if (psiElement != null) {
return psiElement;
}
} else if (virtualFile != null) {
return new OpenFileDescriptor(_project, virtualFile, node.getSourceLines()[0] - 1, 0);
} else {
return null;
}
} else {
return null;
}
}
if ("psi.Element".equals(s)) {
final int[] lines = node.getSourceLines();
if (lines[0] == -1 && lines[1] == -1) { // find anonymous classes
final PsiFile psiFile = _treeHelper.getSelectedFile();
final PsiElement psiElement = IdeaUtilImpl.findAnonymousClassPsiElement(psiFile, node, _project);
if (psiElement != null) {
return psiElement;