void (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); Presentation presentation = e.getPresentation(); String place = e.getPlace(); if (e.getData(ChangesListView.DATA_KEY) == null) { presentation.setEnabled(false); return; } JBIterable<Change> changes = JBIterable.of(e.getData(VcsDataKeys.CHANGES)); JBIterable<FilePath> unversionedFiles = JBIterable.from(e.getData(ChangesListView.UNVERSIONED_FILE_PATHS_DATA_KEY)); if (ActionPlaces.MAIN_MENU.equals(place)) { presentation.setEnabled(project != null && (changes.isNotEmpty() || unversionedFiles.isNotEmpty())); } else { presentation.setEnabled(project != null && canShowDiff(project, changes, unversionedFiles)); } if (ActionPlaces.CHANGES_VIEW_TOOLBAR.equals(place)) { presentation.setVisible(!ExperimentalUI.isNewUI()); } }