Search in sources :

Example 1 with LoadingDiffRequest

use of com.intellij.diff.requests.LoadingDiffRequest 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())));
    }
}
Also used : SimpleDiffRequest(com.intellij.diff.requests.SimpleDiffRequest) MessageDiffRequest(com.intellij.diff.requests.MessageDiffRequest) IntPair(com.intellij.diff.util.IntPair) DiffContent(com.intellij.diff.contents.DiffContent) LoadingDiffRequest(com.intellij.diff.requests.LoadingDiffRequest)

Aggregations

DiffContent (com.intellij.diff.contents.DiffContent)1 LoadingDiffRequest (com.intellij.diff.requests.LoadingDiffRequest)1 MessageDiffRequest (com.intellij.diff.requests.MessageDiffRequest)1 SimpleDiffRequest (com.intellij.diff.requests.SimpleDiffRequest)1 IntPair (com.intellij.diff.util.IntPair)1