void () { Action applyLeft = myViewer.getResolveAction(MergeResult.LEFT); Action applyRight = myViewer.getResolveAction(MergeResult.RIGHT); Action resolveAction = myViewer.getResolveAction(MergeResult.RESOLVED); Action cancelAction = myViewer.getResolveAction(MergeResult.CANCEL); if (resolveAction != null) { resolveAction.putValue(DialogWrapper.DEFAULT_ACTION, true); new DumbAwareAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) { resolveAction.actionPerformed(null); } }.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER, getRootPane(), this); } List<Action> leftActions = ContainerUtil.packNullables(applyLeft, applyRight); List<Action> rightActions = SystemInfo.isMac ? ContainerUtil.packNullables(cancelAction, resolveAction) : ContainerUtil.packNullables(resolveAction, cancelAction); JRootPane rootPane = getRootPane(); JPanel buttonsPanel = new NonOpaquePanel(new BorderLayout()); buttonsPanel.setBorder(new JBEmptyBorder(UIUtil.PANEL_REGULAR_INSETS)); if (leftActions.size() > 0) { buttonsPanel.add(createButtonsPanel(leftActions, rootPane), BorderLayout.WEST); } if (rightActions.size() > 0) { buttonsPanel.add(createButtonsPanel(rightActions, rootPane), BorderLayout.EAST); } myButtonsPanel.setContent(buttonsPanel); }