void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); SplitButton splitButton = ObjectUtils.tryCast(presentation.getClientProperty(CustomComponentAction.COMPONENT_KEY), SplitButton.class); myActionGroup.update(e); if (presentation.isVisible()) { AnAction action = splitButton != null ? splitButton.selectedAction : getFirstEnabledAction(e); if (action != null) { Presentation actionPresentation = e.getUpdateSession().presentation(action); presentation.copyFrom(actionPresentation, splitButton); if (splitButton != null) { boolean shouldRepaint = splitButton.actionEnabled != presentation.isEnabled(); splitButton.actionEnabled = presentation.isEnabled(); if (shouldRepaint) splitButton.repaint(); } presentation.setEnabledAndVisible(true); } presentation.putClientProperty(FIRST_ACTION, splitButton != null ? null : action); } }