Editor () { final EditorFactory editorFactory = EditorFactory.getInstance(); final Document document = editorFactory.createDocument(""); final Editor editor = editorFactory.createViewer(document, myProject); ((EditorEx)editor).setHighlighter(HighlighterFactory.createHighlighter(myProject, myFileName)); return editor; }