use of com.intellij.vcs.log.history.FileHistoryUi in project intellij-community by JetBrains.
the class CreatePatchFromHistoryAction method actionPerformed.
public void actionPerformed(@NotNull AnActionEvent e) {
VcsLogUtil.triggerUsage(e);
Project project = e.getRequiredData(CommonDataKeys.PROJECT);
FileHistoryUi ui = e.getRequiredData(VcsLogInternalDataKeys.FILE_HISTORY_UI);
String commitMessage = e.getRequiredData(VcsDataKeys.PRESET_COMMIT_MESSAGE);
ui.getVcsLog().requestSelectedDetails(detailsList -> {
List<Change> changes = ui.collectChanges(detailsList, false);
CreatePatchFromChangesAction.createPatch(project, commitMessage, changes);
}, null);
}
use of com.intellij.vcs.log.history.FileHistoryUi in project intellij-community by JetBrains.
the class CreatePatchFromHistoryAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
Project project = e.getProject();
FileHistoryUi ui = e.getData(VcsLogInternalDataKeys.FILE_HISTORY_UI);
if (project == null || ui == null) {
e.getPresentation().setEnabledAndVisible(false);
return;
}
e.getPresentation().setVisible(true);
List<CommitId> selectedCommits = ui.getVcsLog().getSelectedCommits();
String commitMessage = e.getData(VcsDataKeys.PRESET_COMMIT_MESSAGE);
e.getPresentation().setEnabled(!selectedCommits.isEmpty() && commitMessage != null);
}
Aggregations