void (@NotNull AnActionEvent e) { MainVcsLogUi ui = e.getData(VcsLogInternalDataKeys.MAIN_UI); VcsLogUiProperties properties = e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES); boolean visible = ui != null && ui.getDataPack().getVisibleGraph().getActionController().isActionSupported(getGraphAction()); e.getPresentation().setVisible(visible); e.getPresentation().setEnabled(visible && !ui.getDataPack().isEmpty()); if (visible) { if (properties != null && properties.exists(MainVcsLogUiProperties.BEK_SORT_TYPE) && properties.get(MainVcsLogUiProperties.BEK_SORT_TYPE) == PermanentGraph.SortType.LinearBek) { e.getPresentation().setText(myMergesAction.get()); e.getPresentation().setDescription(myMergesDescription.get()); } else { e.getPresentation().setText(myLinearBranchesAction.get()); e.getPresentation().setDescription(myLinearBranchesDescription.get()); } } }