1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package Torello.Browser.JsonAST;

import Torello.Java.Additional.Ret2;
import Torello.Java.ReadOnly.ReadOnlyList;

/**
 * Generates HTML that is consistent for all three inheriting sub-types:
 * {@link TypeNode}, {@link CommandNode} & {@link EventNode}.
 */
@Torello.JavaDoc.Annotations.StaticFunctional
@Torello.JavaDoc.Annotations.JDHeaderBackgroundImg(EmbedTagFileID="TOHTML_JDHBI")
public class HTML$TCE
{
    private HTML$TCE() { }

    static final String DIV_TABLE_OPEN = 

        "<DIV CLASS=INNERLABEL>" +
            "<B CLASS=INNERLABEL>**SUB**:</B>" +
            "</DIV>\n" +
        "<TABLE CLASS='INNER **SUB**'>\n" +
        "<TR>" +
            "<TH>Name</TH><TH>Type</TH>"+
            "<TH>Description</TH>" +
            "<TH>Flags</TH>" +
            "</TR>\n";

    static Ret2<String, String> flagsAndRedirectNote(
            final TCE       tce,
            final String    redirect
        )
    {
        final String tempFlagsStr =
            (tce.optional      ? "[OPTIONAL]<BR />\n"      : "") +
            (tce.experimental  ? "[EXPERIMENTAL]<BR />\n"  : "") +
            (tce.deprecated    ? "[DEPRECATED]<BR />\n"    : "");

        final String flagsStr = (tempFlagsStr.length() == 0)
            ? "-"
            : tempFlagsStr;

        final String rNote = (redirect != null)
            ? ("<BR />REDIRECT: " + redirect)
            : "";

        return new Ret2<>(flagsStr, rNote);
    }

    static void appendPPRs(
            final StringBuilder     sb,
            final ReadOnlyList<PPR> pprList,
            final String            label
        )
    {
        sb.append(HTML$TCE.DIV_TABLE_OPEN.replace("**SUB**", label));
        for (final PPR ppr : pprList) sb.append(HTML$PPR.run(ppr));
        sb.append("</TABLE>\n\n");
    }
}