Skip to content

Commit

Permalink
[MPLUGIN-498] Move section rendering to separate methods
Browse files Browse the repository at this point in the history
This closes #248
  • Loading branch information
michael-o committed Dec 26, 2023
1 parent ed4774b commit fc41218
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,28 @@ protected void renderBody() {
return;
}

paragraph(getI18nString("goals.intro"));

boolean hasMavenReport = false;
for (MojoDescriptor mojo : pluginDescriptor.getMojos()) {
if (PluginUtils.isMavenReport(mojo.getImplementation(), project)) {
hasMavenReport = true;
break;
}
}

renderGoalsSection(hasMavenReport);

renderSystemRequirementsSection();

renderRequirementsHistoriesSection();

renderUsageSection(hasMavenReport);

endSection();
}

private void renderGoalsSection(boolean hasMavenReport) {
paragraph(getI18nString("goals.intro"));

startTable();

String goalColumnName = getI18nString("goals.column.goal");
Expand Down Expand Up @@ -144,7 +157,9 @@ protected void renderBody() {
}

endTable();
}

private void renderSystemRequirementsSection() {
startSection(getI18nString("systemrequirements"));

paragraph(getI18nString("systemrequirements.intro"));
Expand All @@ -166,15 +181,9 @@ protected void renderBody() {
endTable();

endSection();

renderRequirementsHistories();

renderUsageSection(hasMavenReport);

endSection();
}

private void renderRequirementsHistories() {
private void renderRequirementsHistoriesSection() {
if (requirementsHistories.isEmpty()) {
return;
}
Expand Down

0 comments on commit fc41218

Please sign in to comment.