void (@NotNull AnActionEvent e) { e.getPresentation().setVisible(true); e.getPresentation().setText(VcsBundle.messagePointer("action.name.create.patch")); e.getPresentation().setDescription(VcsBundle.messagePointer("action.description.create.patch.for.selected.revisions")); VcsFileRevision[] revisions = e.getData(VcsDataKeys.VCS_FILE_REVISIONS); FilePath filePath = e.getData(VcsDataKeys.FILE_PATH); VcsHistoryProvider provider = e.getData(VcsDataKeys.HISTORY_PROVIDER); Project project = e.getProject(); VcsKey vcsKey = e.getData(VcsDataKeys.VCS); if (filePath == null || filePath.isNonLocal() || revisions == null || provider == null || project == null || vcsKey == null) { e.getPresentation().setEnabled(false); return; } if (filePath.isDirectory()) { if (!provider.supportsHistoryForDirectories()) { e.getPresentation().setEnabled(false); } else { e.getPresentation().setEnabled(revisions.length == 1 && revisions[0].getChangedRepositoryPath() != null); } } else { e.getPresentation().setEnabled(false); } }