Full Java Editor only showing one method (editable view)

I have a PsiMethod object and want that displayed in an editor. But I have the following requirements: the editor should behave exactly like the normal IntelliJ Editor for Java files. Syntax highlighting, code completion, inspections, etc. except that it does not show the full class but only one method. Also it should be resized so that this methods fits perfectly.

Is this possible and if so, how?

Please sign in to leave a comment.