Content (PsiElement element, PsiElement originalElement) { Language language = element.getLanguage(); DocToolWindowManager toolWindowManager = DocToolWindowManager.LANGUAGE_MANAGER.forLanguage(language); ToolWindow toolWindow; if (toolWindowManager == null) { toolWindow = myDefaultDocToolWindow; } else { toolWindow = myLangToolWindows.get(language.getID()); } if (toolWindow == null) { createToolWindow(element, originalElement); return null; } final Content content; if (toolWindowManager != null) { content = toolWindowManager.getDocumentationContent(toolWindow, this); } else { content = toolWindow.getContentManager().getSelectedContent(); } if (content == null || !toolWindow.isVisible()) { restorePopupBehavior(); createToolWindow(element, originalElement); return null; } return content; }