void (@NotNull AnActionEvent e) { super.update(e); if (e.getPresentation().isVisible()) { int trimmedSize = ActionGroupUtil.getVisibleActions(this, e).take(4).size(); e.getPresentation().setPopupGroup(trimmedSize > 3); } }