void (@NotNull FileEditorManager source, @NotNull VirtualFile file) { if (!Comparing.equal(file, getVirtualFile())) { return; } Editor selectedTextEditor = source.getSelectedTextEditor(); for (FileEditor fileEditor : source.getAllEditors(file)) { if (!(fileEditor instanceof TextEditor)) { continue; } final EditorEx editor = (EditorEx)((TextEditor)fileEditor).getEditor(); editor.addFocusListener(myFocusListener); if (selectedTextEditor == editor) { // already focused myCurrentEditor = editor; } ActionUtil.copyRegisteredShortcuts(editor.getComponent(), myConsoleEditor.getComponent()); } }