Merge branch 'stable-2.7'
* stable-2.7: Prevent expansion when whole file isn't loaded Generate javadoc for gerrit extension and plugin API Conflicts: gerrit-extension-api/pom.xml gerrit-plugin-api/pom.xml pom.xml tools/deploy_api.sh Change-Id: I8a7d57fe00568713f1dbe8c0fe387e2052c22213
This commit is contained in:
@@ -209,7 +209,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
|||||||
for (int row = 0; row < lines.size(); row++) {
|
for (int row = 0; row < lines.size(); row++) {
|
||||||
setRowItem(row, lines.get(row));
|
setRowItem(row, lines.get(row));
|
||||||
if (lines.get(row) instanceof SkippedLine) {
|
if (lines.get(row) instanceof SkippedLine) {
|
||||||
createSkipLine(row, (SkippedLine) lines.get(row));
|
createSkipLine(row, (SkippedLine) lines.get(row), script.getA().isWholeFile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -540,16 +540,18 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
|||||||
|
|
||||||
if (numRows > 0) {
|
if (numRows > 0) {
|
||||||
line.incrementStart(numRows);
|
line.incrementStart(numRows);
|
||||||
createSkipLine(row + loopTo, line);
|
// If we got here, we must have the whole file anyway.
|
||||||
|
createSkipLine(row + loopTo, line, true);
|
||||||
} else if (numRows < 0) {
|
} else if (numRows < 0) {
|
||||||
line.reduceSize(-numRows);
|
line.reduceSize(-numRows);
|
||||||
createSkipLine(row, line);
|
// If we got here, we must have the whole file anyway.
|
||||||
|
createSkipLine(row, line, true);
|
||||||
} else {
|
} else {
|
||||||
table.removeRow(row + loopTo);
|
table.removeRow(row + loopTo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSkipLine(int row, SkippedLine line) {
|
private void createSkipLine(int row, SkippedLine line, boolean isWholeFile) {
|
||||||
FlowPanel p = new FlowPanel();
|
FlowPanel p = new FlowPanel();
|
||||||
InlineLabel l1 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionStart() + " ");
|
InlineLabel l1 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionStart() + " ");
|
||||||
InlineLabel l2 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionEnd() + " ");
|
InlineLabel l2 = new InlineLabel(" " + PatchUtil.C.patchSkipRegionEnd() + " ");
|
||||||
@@ -558,7 +560,7 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
|||||||
all.addClickHandler(expandAllListener);
|
all.addClickHandler(expandAllListener);
|
||||||
all.setStyleName(Gerrit.RESOURCES.css().skipLine());
|
all.setStyleName(Gerrit.RESOURCES.css().skipLine());
|
||||||
|
|
||||||
if (line.getSize() > 30) {
|
if (line.getSize() > 30 && isWholeFile) {
|
||||||
// Only show the expand before/after if skipped more than 30 lines.
|
// Only show the expand before/after if skipped more than 30 lines.
|
||||||
Anchor b = new Anchor(PatchUtil.M.expandBefore(NUM_ROWS_TO_EXPAND), true);
|
Anchor b = new Anchor(PatchUtil.M.expandBefore(NUM_ROWS_TO_EXPAND), true);
|
||||||
Anchor a = new Anchor(PatchUtil.M.expandAfter(NUM_ROWS_TO_EXPAND), true);
|
Anchor a = new Anchor(PatchUtil.M.expandAfter(NUM_ROWS_TO_EXPAND), true);
|
||||||
@@ -574,10 +576,14 @@ public class SideBySideTable extends AbstractPatchContentTable {
|
|||||||
p.add(all);
|
p.add(all);
|
||||||
p.add(l2);
|
p.add(l2);
|
||||||
p.add(a);
|
p.add(a);
|
||||||
} else {
|
} else if (isWholeFile) {
|
||||||
p.add(l1);
|
p.add(l1);
|
||||||
p.add(all);
|
p.add(all);
|
||||||
p.add(l2);
|
p.add(l2);
|
||||||
|
} else {
|
||||||
|
p.add(l1);
|
||||||
|
p.add(new InlineLabel(" " + line.getSize() + " "));
|
||||||
|
p.add(l2);
|
||||||
}
|
}
|
||||||
table.setWidget(row, 1, p);
|
table.setWidget(row, 1, p);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user