void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); UMethod method = UastContextKt.findUElementAt(element.getContainingFile(), element.getTextOffset(), UMethod.class); if (method == null) return; PsiElement psi = method.getSourcePsi(); if (psi == null) return; Language language = psi.getLanguage(); UastCodeGenerationPlugin plugin = UastCodeGenerationPlugin.byLanguage(language); if (plugin == null) return; boolean kotlin = language != JavaLanguage.INSTANCE; StringBuilder builder = new StringBuilder(); if (kotlin) { builder.append("override fun getOptionsPane() = "); } else { // Use short name for return type, as import will be added anyway when processing the body builder.append("@Override public @org.jetbrains.annotations.NotNull " + OPT_PANE + " getOptionsPane() {\nreturn "); } serialize(myPane, builder); if (!kotlin) { builder.append(";\n}"); } UMethod uMethod = plugin.getElementFactory(project).createMethodFromText(builder.toString(), psi); if (uMethod == null) return; PsiElement newMethod = uMethod.getSourcePsi(); if (newMethod == null) return; shortenReferences(plugin, psi.replace(newMethod)); }