void (@NotNull AnActionEvent e) { boolean isVisible = isVisible(e.getDataContext()); e.getPresentation().setEnabled(isVisible && isEnabled(e.getDataContext())); e.getPresentation().setVisible(isVisible); }