void (@NotNull String actionId, @NotNull ShortcutRestrictions restrictions, @NotNull Keymap keymapSelected, @NotNull Component parent, QuickList @NotNull ... quickLists) { if (!restrictions.allowMouseShortcut) return; MouseShortcutDialog dialog = new MouseShortcutDialog(parent, restrictions.allowMouseDoubleClick); MouseShortcut mouseShortcut = dialog.showAndGet(actionId, keymapSelected, quickLists); if (mouseShortcut == null) return; SafeKeymapAccessor accessor = new SafeKeymapAccessor(parent, keymapSelected); if (dialog.hasConflicts()) { int result = showConfirmationDialog(parent); if (result == Messages.YES) { Keymap keymap = accessor.keymap(); for (String id : keymap.getActionIds(mouseShortcut)) { keymap.removeShortcut(id, mouseShortcut); } } else if (result != Messages.NO) { return; } } accessor.add(actionId, mouseShortcut); }