void (@NotNull AnActionEvent e) { Presentation p = e.getPresentation(); T scheme = getCurrentScheme(); boolean isEnabled = scheme != null && mySchemesPanel.getModel().canDeleteScheme(scheme); if (mySchemesPanel.hideDeleteActionIfUnavailable()) { p.setEnabledAndVisible(isEnabled); } else { p.setEnabled(isEnabled); } }