Editor does not show up

Hey,

I've just tried to create an Editor by invoking this method:
EditorFactory.getInstance().createEditor(EditorFactory.getInstance().createDocument(""),e.getProject());
But there is no editor showing up.
What am i doing wrong?

5 comments

Hello,

You successfully created an editor but not surrounding ui infrastructure that builts it into the ide.

You should use FileEditorManager.openFile() or FileEditorManager.openEditor() instead

Denis

0

I try to open an Editor without the need of a VirutalFile. Is there a way to do this?

0

All editors displayed in IDE tabs must be backed by virtual files. You can create your own VirtualFileSystem and VirtualFile implementations to support displaying stuff which is not backed by real on-disk files.

0

Okay, thanks for your answers!
I've allready tested the solution you've just described and it works flawlessly, but i was still wondering how to do this without the need of a VirtualFile.

0

Well, as Dmitry has mentioned, you need a backing VirtualFile. The only advice is to use built-in in-memory VirtualFile representation - LightVirtualFile

Denis

0

Please sign in to leave a comment.