SortedSet<ModuleName> rootLevelModules = new TreeSet<ModuleName>();
for (final Map.Entry<Pair<ModuleName, Boolean>, ModuleHierarchyInfo> entry : node.getChildren().entrySet()) {
final Pair<ModuleName, Boolean> key = entry.getKey();
final ModuleName childName = key.fst();
final ModuleHierarchyInfo child = entry.getValue();
if (child.getChildren().isEmpty()) {
rootLevelModules.add(childName);
}
}
// first list out the modules with "namespaces" (i.e. their names have >1 components)
for (final Map.Entry<Pair<ModuleName, Boolean>, ModuleHierarchyInfo> entry : node.getChildren().entrySet()) {
final Pair<ModuleName, Boolean> key = entry.getKey();
final ModuleName childName = key.fst();
final ModuleHierarchyInfo child = entry.getValue();
if (rootLevelModules.contains(childName)) {
continue;
}
currentPage
.openTag(HTML.Tag.DIV, classAttribute(StyleClassConstants.RELATED_MODULES_LIST))
.addText(childName.toSourceText())
.addText(LocalizableUserVisibleString.COLON.toResourceString())
.addText(" ");
int counter2 = 0;
for (final Pair<ModuleName, Boolean> key2 : child.getChildren().keySet()) {
final ModuleName childName2 = key2.fst();
if (counter2 > 0) {
currentPage.addText(LocalizableUserVisibleString.COMMA_AND_SPACE.toResourceString());
}
generateModuleReference(currentPage, null, childName2, childName2.getLastComponent());
counter2++;
}
currentPage.closeTag(HTML.Tag.DIV);