DefaultActionGroup (@NotNull JComponent button, @NotNull DataContext context) { DefaultActionGroup actionGroup = new DefaultActionGroup(); for (final T item : myItems) { if (addSeparator(actionGroup, item)) { continue; } AnAction action = new AnAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) { if (mySelection != item && selectionChanged(item)) { mySelection = item; AbstractComboBoxAction.this.update(item, myPresentation, false); } } }; actionGroup.add(action); Presentation presentation = action.getTemplatePresentation(); presentation.setIcon(mySelection == item ? CHECKED : null); update(item, presentation, true); } return actionGroup; }