void (@NotNull AnActionEvent e) { RangeSearchTask task = myRangeSearch.getLastExecutedRangeSearchTask(); e.getPresentation().setEnabled( task != null && !task.isFinished() && !task.isShouldStop() ); }