void (@NotNull AnActionEvent e) { super.update(e); e.getPresentation().setVisible(true); Project project = e.getProject(); VcsLogCommitSelection selection = e.getData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION); if (selection == null || project == null) { e.getPresentation().setEnabledAndVisible(false); return; } VcsCherryPickManager cherryPickManager = VcsCherryPickManager.getInstance(project); List<VcsCherryPicker> cherryPickers = getActiveCherryPickersForProject(project); if (cherryPickers.isEmpty()) { e.getPresentation().setEnabledAndVisible(false); return; } List<CommitId> commits = ContainerUtil.getFirstItems(selection.getCommits(), VcsLogUtil.MAX_SELECTED_COMMITS); if (commits.isEmpty() || cherryPickManager.isCherryPickAlreadyStartedFor(commits)) { e.getPresentation().setEnabled(false); return; } final Map<VirtualFile, List<Hash>> groupedByRoot = groupByRoot(commits); VcsCherryPicker activeCherryPicker = getActiveCherryPicker(cherryPickers, groupedByRoot.keySet()); e.getPresentation().setEnabled(activeCherryPicker != null); e.getPresentation() .setText(activeCherryPicker == null ? concatActionNamesForAllAvailable(cherryPickers) : activeCherryPicker.getActionTitle()); e.getPresentation().setDescription(activeCherryPicker != null ? "" : DvcsBundle.message("cherry.pick.action.description")); }