boolean () { ToolWindow window = ProblemsView.getToolWindow(getProject()); if (window == null || !window.isActive()) return false; Content content = window.getContentManager().getSelectedContent(); if (content == null) return false; return SwingUtilities.isDescendingFrom(this, content.getComponent()); }