JPanel (@NotNull AnAction action, @NotNull AnActionLink actionLink) { JPanel actionPanel = new JPanel(new GridBagLayout()); GridBag gridBag = new GridBag().fillCellHorizontally().anchor(GridBagConstraints.WEST); int topInset = 5; int bottomInset = 4; actionPanel.add(actionLink, gridBag.next().insets(topInset, 10, bottomInset, 4)); Shortcut[] shortcuts = action.getShortcutSet().getShortcuts(); String shortcutsText = KeymapUtil.getShortcutsText(shortcuts); if (!shortcutsText.isEmpty()) { JComponent keymapHint = createKeymapHint(shortcutsText); actionPanel.add(keymapHint, gridBag.next().insets(topInset, 4, bottomInset, 12)); } actionPanel.setBackground(UIUtil.getToolTipActionBackground()); return actionPanel; }