}
setRegisterKeys(active);
}
void initializeRow(int row) {
Patch patch = PatchTable.this.patchList.get(row - 1);
setRowItem(row, patch);
Widget nameCol;
if (patch.getPatchType() == Patch.PatchType.UNIFIED) {
nameCol = new PatchLink.SideBySide(getDisplayFileName(patch), base,
patch.getKey(), row - 1, detail, PatchTable.this);
} else {
nameCol = new PatchLink.Unified(getDisplayFileName(patch), base,
patch.getKey(), row - 1, detail, PatchTable.this);
}
if (patch.getSourceFileName() != null) {
final String text;
if (patch.getChangeType() == Patch.ChangeType.RENAMED) {
text = Util.M.renamedFrom(patch.getSourceFileName());
} else if (patch.getChangeType() == Patch.ChangeType.COPIED) {
text = Util.M.copiedFrom(patch.getSourceFileName());
} else {
text = Util.M.otherFrom(patch.getSourceFileName());
}
final Label line = new Label(text);
line.setStyleName(Gerrit.RESOURCES.css().sourceFilePath());
final FlowPanel cell = new FlowPanel();
cell.add(nameCol);
cell.add(line);
nameCol = cell;
}
table.setWidget(row, C_PATH, nameCol);
int C_UNIFIED = C_SIDEBYSIDE + 1;
if (patch.getPatchType() == Patch.PatchType.UNIFIED) {
table.setWidget(row, C_SIDEBYSIDE, new PatchLink.SideBySide(
Util.C.patchTableDiffSideBySide(), base, patch.getKey(), row - 1,
detail, PatchTable.this));
} else if (patch.getPatchType() == Patch.PatchType.BINARY) {
C_UNIFIED = C_SIDEBYSIDE + 2;
}
table.setWidget(row, C_UNIFIED, new PatchLink.Unified(
Util.C.patchTableDiffUnified(), base, patch.getKey(), row - 1,
detail, PatchTable.this));
}