void (@NotNull AnActionEvent e) { CompareBranchesDiffPanel panel = e.getRequiredData(DATA_KEY); Presentation presentation = e.getPresentation(); presentation.setText(DvcsBundle.messagePointer("compare.branches.diff.panel.get.from.branch.action")); presentation.setDescription(DvcsBundle.messagePointer("compare.branches.diff.panel.get.from.branch.action.description", panel.myBranchName)); boolean isEnabled = !panel.myChangesBrowser.getSelectedChanges().isEmpty(); boolean isVisible = panel.myCompareInfo instanceof LocalCommitCompareInfo; presentation.setEnabled(isEnabled && isVisible); presentation.setVisible(isVisible); }