void (@NotNull VirtualFile file, @NotNull FileEditorManager source) { MyRunAction runAction = new MyRunAction(); for (FileEditor fileEditor : source.getEditors(file)) { if (!(fileEditor instanceof TextEditor)) continue; Editor editor = ((TextEditor)fileEditor).getEditor(); runAction.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER, editor.getComponent()); } }