boolean (AnActionEvent e) { Component component = e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT); if (!(component instanceof JTree) && !(component instanceof JList)) { return false; } VirtualFile virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE); PsiElement psiElement = e.getData(CommonDataKeys.PSI_ELEMENT); Project project = e.getProject(); if (project != null && (virtualFile != null || psiElement != null)) { DataContext context = e.getDataContext(); for (ImplementationViewSessionFactory factory : getSessionFactories()) { ImplementationViewSession session = factory.createSession(context, project, isSearchDeep(), isIncludeAlwaysSelf()); if (session != null) { return true; } } } return false; }