Editor () { TextEditor fileEditor = getTextEditor(); if (fileEditor != null) { return fileEditor.getEditor(); } else if (myMockTextEditor == null) { myMockTextEditor = EditorFactory.getInstance().createViewer(new DocumentImpl(""), myProject); } return myMockTextEditor; }