void (@NotNull AnActionEvent e) { e.getPresentation().setIcon(e.isFromActionToolbar() ? AllIcons.Actions.Cancel : null); CloseTarget closeTarget = e.getData(CloseTarget.KEY); e.getPresentation().setEnabled(closeTarget != null); }