private ClassNameEditorWithBrowseButton(ActionListener browseActionListener, final Project project) { super(browseActionListener, project, s -> { JavaCodeFragment fragment = new PsiTypeCodeFragmentImpl(project, true, "fragment.java", s, 0, null) { @Override public boolean importClass(PsiClass aClass) { return false; } }; fragment.setVisibilityChecker(JavaCodeFragment.VisibilityChecker.EVERYTHING_VISIBLE); return PsiDocumentManager.getInstance(project).getDocument(fragment); }, ""); }
@NotNull @Override public PsiTypeCodeFragment createTypeCodeFragment(@NotNull final String text, @Nullable final PsiElement context, final boolean isPhysical, final int flags) { return new PsiTypeCodeFragmentImpl(myProject, isPhysical, "fragment.java", text, flags, context); }