JComponent (@NotNull PsiFile file) { final Project project = file.getProject(); final Document document = PsiDocumentManager.getInstance(project).getDocument(file); if (document != null) { return new CheckRegExpForm(file).getRootPanel(); } return null; }