void (@NotNull AnActionEvent e) { Change[] changes = e.getData(VcsDataKeys.CHANGES); JBIterable<FilePath> unversioned = JBIterable.from(e.getData(ChangesListView.UNVERSIONED_FILE_PATHS_DATA_KEY)); if (ArrayUtil.isEmpty(changes) && unversioned.isEmpty()) { e.getPresentation().setEnabled(false); return; } ChangeList[] changeLists = e.getData(VcsDataKeys.CHANGE_LISTS); List<ShelvedChangeList> shelveChangelists = ShelvedChangesViewManager.getShelvedLists(e.getDataContext()); int changelistNum = changeLists == null ? 0 : changeLists.length; changelistNum += shelveChangelists.size(); if (changelistNum > 1) { e.getPresentation().setEnabled(false); return; } e.getPresentation().setEnabled(true); }