michael-o commented on code in PR #47:
URL:
https://github.com/apache/maven-project-info-reports-plugin/pull/47#discussion_r1199821656
##########
src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java:
##########
@@ -607,25 +608,76 @@ private void renderSectionDependencyFileDetails() {
justification[0] = Sink.JUSTIFY_RIGHT;
justification[6] = Sink.JUSTIFY_RIGHT;
- for (int i = -1; i < TotalCell.SCOPES_COUNT; i++) {
- if (totaldeps.getTotal(i) > 0) {
- tableRow(hasSealed, new String[] {
- totaldeps.getTotalString(i),
- totaldepsize.getTotalString(i),
- totalentries.getTotalString(i),
- totalclasses.getTotalString(i),
- totalpackages.getTotalString(i),
- (i < 0) ? javaVersionFormat.format(new Object[]
{highestJavaVersion}) : "",
- totalDebugInformation.getTotalString(i),
- totalsealed.getTotalString(i)
- });
+ // calculate rowspan attr
+ int rowspan = computeRowspan(totaldeps);
+
+ if (rowspan > 1) {
+ boolean insertRowspanAttr = false;
+ int column = 5; // Java Version's column
+ for (int i = -1; i < TotalCell.SCOPES_COUNT; i++) {
+ if (totaldeps.getTotal(i) > 0) {
+ boolean alreadyInsertedRowspanAttr = insertRowspanAttr &&
(0 < i && i < 4);
+ insertRowspanAttr = (0 <= i && i < 4);
+ justification[column] = (insertRowspanAttr &&
alreadyInsertedRowspanAttr)
+ ? justification[column + 1]
+ : Sink.JUSTIFY_CENTER;
+ tableRowWithRowspan(
+ hasSealed, insertRowspanAttr,
alreadyInsertedRowspanAttr, column, rowspan, new String[] {
+ totaldeps.getTotalString(i),
+ totaldepsize.getTotalString(i),
+ totalentries.getTotalString(i),
+ totalclasses.getTotalString(i),
+ totalpackages.getTotalString(i),
+ formatMaxVersionForScope(i,
highestTestJavaVersion, highestNonTestJavaVersion),
+ totalDebugInformation.getTotalString(i),
+ totalsealed.getTotalString(i)
+ });
+ }
+ }
+ } else {
+ for (int i = -1; i < TotalCell.SCOPES_COUNT; i++) {
+ if (totaldeps.getTotal(i) > 0) {
+ tableRow(hasSealed, new String[] {
+ totaldeps.getTotalString(i),
+ totaldepsize.getTotalString(i),
+ totalentries.getTotalString(i),
+ totalclasses.getTotalString(i),
+ totalpackages.getTotalString(i),
+ formatMaxVersionForScope(i, highestTestJavaVersion,
highestNonTestJavaVersion),
+ totalDebugInformation.getTotalString(i),
+ totalsealed.getTotalString(i)
+ });
+ }
}
}
endTable();
endSection();
}
+ private int computeRowspan(TotalCell totaldeps) {
+ int rowspan = 0;
+ for (int i = 0; i < TotalCell.SCOPES_COUNT - 1; i++) {
+ if (totaldeps.getTotal(i) > 0) {
+ rowspan++;
+ }
+ }
+ return rowspan;
+ }
+
+ private String formatMaxVersionForScope(
Review Comment:
Let's make this `formatMaxJavaVersionForScope`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]