void (@NotNull AnActionEvent e) { if (!myExtension.hasAnyExtensions()) { e.getPresentation().setEnabledAndVisible(false); } else { boolean enabled = isEnabled(e); if (ActionPlaces.isPopupPlace(e.getPlace())) { e.getPresentation().setVisible(enabled); } else { e.getPresentation().setVisible(true); } e.getPresentation().setEnabled(enabled); } }