use of com.intellij.diff.requests.MessageDiffRequest in project intellij-community by JetBrains.
the class VcsSelectionHistoryDialog method updateDiff.
private void updateDiff() {
if (myIsDisposed || myIsDuringUpdate)
return;
if (myList.getSelectedRowCount() == 0) {
myDiffPanel.setRequest(NoDiffRequest.INSTANCE);
return;
}
int count = myRevisions.size();
IntPair range = getSelectedRevisionsRange();
int revIndex1 = range.val2;
int revIndex2 = range.val1;
if (revIndex1 == count && revIndex2 == count) {
myDiffPanel.setRequest(NoDiffRequest.INSTANCE);
return;
}
BlockData blockData = myBlockLoader.getLoadedData();
DiffContent content1 = createDiffContent(revIndex1, blockData);
DiffContent content2 = createDiffContent(revIndex2, blockData);
String title1 = createDiffContentTitle(revIndex1);
String title2 = createDiffContentTitle(revIndex2);
if (content1 != null && content2 != null) {
myDiffPanel.setRequest(new SimpleDiffRequest(null, content1, content2, title1, title2), new IntPair(revIndex1, revIndex2));
return;
}
if (blockData.isLoading()) {
myDiffPanel.setRequest(new LoadingDiffRequest());
} else {
myDiffPanel.setRequest(new MessageDiffRequest(canNoLoadMessage(blockData.getException())));
}
}
use of com.intellij.diff.requests.MessageDiffRequest in project intellij-community by JetBrains.
the class VcsDiffUtil method showDiffFor.
@CalledInAwt
public static void showDiffFor(@NotNull Project project, @NotNull final Collection<Change> changes, @NotNull final String revNumTitle1, @NotNull final String revNumTitle2, @NotNull final FilePath filePath) {
if (filePath.isDirectory()) {
showChangesDialog(project, getDialogTitle(filePath, revNumTitle1, revNumTitle2), ContainerUtil.newArrayList(changes));
} else {
if (changes.isEmpty()) {
DiffManager.getInstance().showDiff(project, new MessageDiffRequest("No Changes Found"));
} else {
final HashMap<Key, Object> revTitlesMap = new HashMap<>(2);
revTitlesMap.put(VCS_DIFF_LEFT_CONTENT_TITLE, revNumTitle1);
revTitlesMap.put(VCS_DIFF_RIGHT_CONTENT_TITLE, revNumTitle2);
ShowDiffContext showDiffContext = new ShowDiffContext() {
@NotNull
@Override
public Map<Key, Object> getChangeContext(@NotNull Change change) {
return revTitlesMap;
}
};
ShowDiffAction.showDiffForChange(project, changes, 0, showDiffContext);
}
}
}
Aggregations