001package Torello.Browser.JsonAST; 002 003import Torello.Java.Additional.Ret2; 004import Torello.Java.StrIndent; 005 006/** 007 * Generates the HTML for the elements of the {@code "events"} array, which is a sub-property 008 * of a {@code "domain"} object. 009 */ 010@Torello.JavaDoc.Annotations.StaticFunctional 011@Torello.JavaDoc.Annotations.JDHeaderBackgroundImg(EmbedTagFileID="TOHTML_JDHBI") 012public class HTML$EventNode 013{ 014 private HTML$EventNode() { } 015 016 static String run(final EventNode eventNode) 017 { 018 // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 019 // FLAGS HTML, Possible 'Redirect' Note 020 // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 021 022 final Ret2<String, String> r2 = HTML$TCE.flagsAndRedirectNote(eventNode, null); 023 final String flagsStr = r2.a; 024 final String rNote = r2.b; 025 026 if (eventNode.enumValsStr != null) 027 throw (Error) eventNode.verifyThrow("Event Node has an EnumVals Str"); 028 029 030 // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 031 // HTML Inner-Tables: 'Event 032 // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 033 034 final StringBuilder sb = new StringBuilder(); 035 036 if (eventNode.parameters != null) 037 HTML$TCE.appendPPRs(sb, eventNode.parameters, "PARAMETERS"); 038 039 final String innerTablesRow; 040 041 if (sb.length() == 0) innerTablesRow = ""; 042 043 else innerTablesRow = 044 "<TR><TD COLSPAN=3>\n" + 045 StrIndent.indent(sb.toString(), 4) + 046 "</TD></TR>\n"; 047 048 049 // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 050 // Return the HTML 051 // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 052 053 final String descStr = eventNode.description.replace("<", "<").replace(">", ">"); 054 055 return 056 "<TR>\n" + 057 " <TD CLASS=MAINNAME>" + 058 "<SPAN CLASS=MAINNAME>" + eventNode.name + "</SPAN>" + 059 rNote + "</TD>\n" + 060 " <TD>" + descStr + "</TD>\n" + 061 " <TD>" + flagsStr + "</TD>\n" + 062 "</TR>\n" + 063 innerTablesRow; 064 } 065}