Added sorting to elddoc lists and updated site pages for better english.

This commit is contained in:
Willem Cazander 2012-12-21 03:01:48 +01:00
parent aa9c9743d7
commit 4a700f98a6
10 changed files with 225 additions and 78 deletions

View file

@ -31,6 +31,8 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
@ -186,7 +188,9 @@ public class EldDocHtmlWriter {
printHeader(pw,"Overview Modules ("+title+")","");
printPageIndexTitle(pw,title,null,null);
printTableStart(pw,"Modules");
for (ElementLanguageModule mod:context.getElementLanguageModules()) {
List<ElementLanguageModule> mods = context.getElementLanguageModules();
Collections.sort(mods,new ElementLanguageModuleComparator());
for (ElementLanguageModule mod:mods) {
printTableRowOverview(pw,toSafeUri(mod.getId())+"/index.html",mod.getId(),mod.getName());
}
printTableEnd(pw);
@ -205,7 +209,9 @@ public class EldDocHtmlWriter {
String title = context.getLanguageConfiguration().getLanguage()+" "+context.getLanguageConfiguration().getLanguageVersion()+" ELD";
printHeader(pw,"Overview Namespace("+title+")",pathPrefix);
printPageIndexTitle(pw,title,null,null);
for (ElementLanguageModule mod:context.getElementLanguageModules()) {
List<ElementLanguageModule> mods = context.getElementLanguageModules();
Collections.sort(mods,new ElementLanguageModuleComparator());
for (ElementLanguageModule mod:mods) {
printNamespaces(pw,mod.getElementNamespaceContexts(),pathPrefix,mod);
}
printBottom(pw,pathPrefix);
@ -240,6 +246,7 @@ public class EldDocHtmlWriter {
}
}
}
Collections.sort(rootNodes,new TreeNodeComparator());
for (TreeNode rootNode:rootNodes) {
walkTree(rootNode,pw,pathPrefix);
}
@ -326,7 +333,7 @@ public class EldDocHtmlWriter {
}
}
}
Collections.sort(result,new TreeNodeComparator());
return result;
}
@ -384,7 +391,7 @@ public class EldDocHtmlWriter {
}
}
}
Collections.sort(result,new TreeNodeComparator());
return result;
}
@ -421,7 +428,9 @@ public class EldDocHtmlWriter {
printPageTitle(pw,"Namespace",ns.getUri(),ns.getDescription());
printTableStart(pw,"Element Summary");
for (ElementClass ec:ns.getElementClasses()) {
List<ElementClass> ecs = ns.getElementClasses();
Collections.sort(ecs,new ElementClassComparator());
for (ElementClass ec:ecs) {
printTableRowOverview(pw,toSafeUri(ec.getTag())+"/index.html",ec.getTag(),ec.getDescription());
}
printTableEnd(pw);
@ -980,4 +989,22 @@ public class EldDocHtmlWriter {
pw.print("\t\t<td class=\"NavBarCell1\"><a href=\""+pathPrefix+"namespace-overview.html\">Namespaces</a>&nbsp;</td>\n");
pw.print("\t\t<td class=\"NavBarCell1\"><a href=\""+pathPrefix+"tree-overview.html\">Tree</a>&nbsp;</td>\n");
}
class ElementLanguageModuleComparator implements Comparator<ElementLanguageModule> {
public int compare(ElementLanguageModule o1,ElementLanguageModule o2) {
return o1.getId().compareTo(o2.getId());
}
}
class TreeNodeComparator implements Comparator<TreeNode> {
public int compare(TreeNode o1,TreeNode o2) {
return o1.elementClass.getTag().compareTo(o2.elementClass.getTag());
}
}
class ElementClassComparator implements Comparator<ElementClass> {
public int compare(ElementClass o1,ElementClass o2) {
return o1.getTag().compareTo(o2.getTag());
}
}
}