Search in sources :

Example 1 with FileInfo

use of com.google.gerrit.client.info.FileInfo in project gerrit by GerritCodeReview.

the class Header method setupPrevNextFiles.

void setupPrevNextFiles(CommentsCollections comments) {
    FileInfo prevInfo = null;
    FileInfo nextInfo = null;
    int currIndex = findCurrentFileIndex(files);
    for (int i = currIndex - 1; i >= 0; i--) {
        FileInfo curr = files.get(i);
        if (shouldSkipFile(curr, comments)) {
            continue;
        }
        prevInfo = curr;
        break;
    }
    for (int i = currIndex + 1; i < files.length(); i++) {
        FileInfo curr = files.get(i);
        if (shouldSkipFile(curr, comments)) {
            continue;
        }
        nextInfo = curr;
        break;
    }
    KeyCommand p = setupNav(prev, '[', PatchUtil.C.previousFileHelp(), prevInfo);
    KeyCommand n = setupNav(next, ']', PatchUtil.C.nextFileHelp(), nextInfo);
    if (p != null && n != null) {
        keys.pair(p, n);
    }
    nextPath = nextInfo != null ? nextInfo.path() : null;
}
Also used : FileInfo(com.google.gerrit.client.info.FileInfo) KeyCommand(com.google.gwtexpui.globalkey.client.KeyCommand)

Aggregations

FileInfo (com.google.gerrit.client.info.FileInfo)1 KeyCommand (com.google.gwtexpui.globalkey.client.KeyCommand)1