LargeFileEditor (boolean createIfNotExists, Project project, VirtualFile virtualFile) { FileEditorManager fileEditorManager = FileEditorManager.getInstance(project); if (createIfNotExists) { FileEditor[] fileEditors = fileEditorManager.openFile(virtualFile, false, true); for (FileEditor fileEditor : fileEditors) { if (fileEditor instanceof LargeFileEditor) { return (LargeFileEditor)fileEditor; } } } else { FileEditor[] existedFileEditors = fileEditorManager.getEditors(virtualFile); for (FileEditor fileEditor : existedFileEditors) { if (fileEditor instanceof LargeFileEditor) { return (LargeFileEditor)fileEditor; } } } return null; }