use of com.intellij.openapi.vcs.changes.patch.ApplyPatchDifferentiatedDialog in project intellij-community by JetBrains.
the class MergeFromTheirsResolver method selectPatchesInApplyPatchDialog.
@CalledInAwt
private void selectPatchesInApplyPatchDialog(@NotNull Consumer<VcsException> callback) throws VcsException {
LocalChangeList changeList = ChangeListManager.getInstance(myVcs.getProject()).getChangeList(myChange);
TreeConflictApplyTheirsPatchExecutor patchExecutor = new TreeConflictApplyTheirsPatchExecutor(myVcs, myBaseForPatch);
ApplyPatchDifferentiatedDialog dialog = new ApplyPatchDifferentiatedDialog(myVcs.getProject(), patchExecutor, singletonList(new ApplyPatchSaveToFileExecutor(myVcs.getProject(), myBaseForPatch)), ApplyPatchMode.APPLY_PATCH_IN_MEMORY, myTextPatches, changeList);
// dialog is not modal - so such async behavior is used
patchExecutor.myPromise.done(callback);
dialog.show();
}
use of com.intellij.openapi.vcs.changes.patch.ApplyPatchDifferentiatedDialog in project intellij-community by JetBrains.
the class UnshelveWithDialogAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = ObjectUtils.assertNotNull(getEventProject(e));
DataContext dataContext = e.getDataContext();
final List<ShelvedChangeList> changeLists = ShelvedChangesViewManager.getShelvedLists(dataContext);
if (changeLists.isEmpty())
return;
FileDocumentManager.getInstance().saveAllDocuments();
if (changeLists.size() > 1) {
unshelveMultipleShelveChangeLists(project, changeLists, getBinaryShelveChanges(dataContext), getShelveChanges(dataContext));
} else {
ShelvedChangeList changeList = changeLists.get(0);
final VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(new File(changeList.PATH));
if (virtualFile == null) {
VcsBalloonProblemNotifier.showOverChangesView(project, "Can not find path file", MessageType.ERROR);
return;
}
List<ShelvedBinaryFilePatch> binaryShelvedPatches = ContainerUtil.map(changeList.getBinaryFiles(), ShelvedBinaryFilePatch::new);
final ApplyPatchDifferentiatedDialog dialog = new MyUnshelveDialog(project, virtualFile, changeList, binaryShelvedPatches, e.getData(VcsDataKeys.CHANGES));
dialog.setHelpId("reference.dialogs.vcs.unshelve");
dialog.show();
}
}
Aggregations