OpenKeyWord  Build_ID: 457, Datum: 01.02.2020 07:45:48
Dont repeat yourself. - Do it once and only once!
ResultList.java
1 package okw.log.log2html;
2 
3 import org.apache.commons.text.StringEscapeUtils;
4 
5 public class ResultList extends LogBaseNode
6 {
7  private String type = "ResultList";
8  String myReturn = "";
9 
10  ResultList(LogBase Parent, String fpsListHeader)
11  {
12  setParent(Parent);
13  myID = AllCount;
14 
15  this.Info = fpsListHeader;
16  }
17 
18  public void setReturn(String fpsReturn)
19  {
20  myReturn = fpsReturn;
21  }
22 
23  protected void SetFail()
24  {
25  }
26 
27  protected void SetPass()
28  {
29  }
30 
31  @Override
32  protected String getHTMLResult()
33  {
34  StringBuilder sbResult = new StringBuilder();
35 
36  String lvsIndention = this.getLevelIndention();
37 
38  //sbResult.append( lvsIndention + "<blockquote class='" + this.getClass().getSimpleName() + "'>\n" );
39 
40  sbResult.append( lvsIndention + "<div class='" + this.getClass().getSimpleName() + "'>\n" );
41  sbResult.append( lvsIndention + myIndentionBase +"<div class='Header'>\n" );
42 
43  // Aufklappen wenn myLogs Werte enthält...
44  if (!this.myLogs.isEmpty())
45  {
46  sbResult.append( lvsIndention + myIndentionBase + myIndentionBase + "<div class='FoldMe' onClick='div_change(" + myID.toString() + ")'></div>\n" );
47  }
48 
49  sbResult.append( lvsIndention + myIndentionBase + myIndentionBase + "<div class='Info_ResultList'>" + StringEscapeUtils.escapeHtml4(this.Info) + "</div>\n" );
50 
51  sbResult.append( lvsIndention + myIndentionBase + myIndentionBase + "</div>\n" ); // end Header
52 
53  // Body der Klappbox
54  sbResult.append( lvsIndention + myIndentionBase + myIndentionBase +"<div class='Body' id='" + myID.toString() +"' style='display: none;'>\n" );
55 
56  for( LogBase myLog: this.myLogs )
57  {
58  sbResult.append( myLog.getHTMLResult() );
59  }
60 
61  sbResult.append( lvsIndention + myIndentionBase + myIndentionBase + "</div>\n" ); // end Body
62 
63  sbResult.append( lvsIndention + myIndentionBase + myIndentionBase + "</div>\n" ); // end Rahmen
64  //sbResult.append( lvsIndention + "</blockquote>\n");
65 
66  return sbResult.toString();
67  }
68 
69 
70  @Override
71  protected String getJSONNodeProperties()
72  {
73  StringBuilder myJSON = new StringBuilder();
74 
75  myJSON.append( this.jsonElementComma( "type", this.type ) );
76  myJSON.append( this.jsonElementComma( "info", this.Info ) );
77 
78  return myJSON.toString();
79  }
80 }
okw.log.log2html.ResultList
Definition: ResultList.java:5
okw.log.log2html.LogBaseNode
Definition: LogBaseNode.java:3
okw.log.log2html.LogBase
Definition: LogBase.java:7