void (@NotNull AnActionEvent e) { boolean selected = isSelected(); Presentation presentation = e.getPresentation(); presentation.setIcon(selected ? selectedIcon : icon); presentation.setHoveredIcon(selected ? selectedIcon : hoveredIcon); }