JComponent (@NotNull Presentation presentation, @NotNull String place) { return new ActionButton(this, presentation, place, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE) { @Override protected void updateToolTipText() { HelpTooltip.dispose(this); new HelpTooltip() .setTitle(myPresentation.getText()) .setShortcut(getShortcut()) .setDescription(IdeBundle.message("run.anything.action.tooltip.text")) .installOn(this); } private static @Nullable String getShortcut() { if (ourDoubleCtrlRegistered) { return IdeBundle.message("double.ctrl.or.shift.shortcut", SystemInfo.isMac ? FontUtil.thinSpace() + MacKeymapUtil.CONTROL : "Ctrl"); //NON-NLS } //keymap shortcut is added automatically return null; } @Override public void setToolTipText(String s) { String shortcutText = getShortcutText(); super.setToolTipText(StringUtil.isNotEmpty(shortcutText) ? (s + " (" + shortcutText + ")") : s); } }; }