Content (PsiElement element, PsiElement originalElement) { if (myToolWindow == null) { createToolWindow(element, originalElement); return null; } final Content content = myToolWindow.getContentManager().getSelectedContent(); if (content == null || !myToolWindow.isVisible()) { restorePopupBehavior(); createToolWindow(element, originalElement); return null; } return content; }