BrightSide Workbench Full Report + Source Code
org.turro.registry.RegistryHTMLFormatter Class Reference

Public Member Functions

 RegistryHTMLFormatter (HTMLGenerator html, Changes changes)
 
HTMLGenerator generate ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 28 of file RegistryHTMLFormatter.java.

Constructor & Destructor Documentation

◆ RegistryHTMLFormatter()

org.turro.registry.RegistryHTMLFormatter.RegistryHTMLFormatter ( HTMLGenerator  html,
Changes  changes 
)

Definition at line 33 of file RegistryHTMLFormatter.java.

33  {
34  this.html = html;
35  this.changes = changes == null ? new Changes() : changes;
36  }

Member Function Documentation

◆ generate()

HTMLGenerator org.turro.registry.RegistryHTMLFormatter.generate ( )

Definition at line 38 of file RegistryHTMLFormatter.java.

38  {
39  ChangeCategory last = null;
40  changes.clearEquals();
41  html.startTable("width='100%' style='width:100%'");
42  html.startTableCol("");
43  for(IChange c : changes) {
44  if(!c.getCategory().equals(last)) {
45  if(!Strings.isBlank(c.getCategory().getCaption())) {
46  last = c.getCategory();
47  html.startTag("div", " style='border-bottom: solid 1px #eeeeee;font-weight:bold; margin-top:10px;'")
48  .write(c.getCategory().getCaption())
49  .endTag();
50  }
51  }
52  if(Strings.isBlank(c.getLabel()) && c.isOnlyNew()) {
53  html.startTag("p")
54  .write(StringParser.toHTML(c.getNewValueString()))
55  .endTag();
56  } else if(c.isOnlyNew()) {
57  html.startTag("p")
58  .write(StringParser.toHTML(c.getLabel()))
59  .write(": ")
60  .write(StringParser.toHTML(c.getNewValueString()))
61  .endTag();
62  } else {
63  html.startTag("p")
64  .write(StringParser.toHTML(c.getLabel()))
65  .write(" [")
66  .write(StringParser.toHTML(c.getOldValueString()))
67  .write("]: ")
68  .write(StringParser.toHTML(c.getNewValueString()))
69  .endTag();
70  }
71  }
72  html.endAllTags();
73  return html;
74  }
HTMLGenerator write(String value)
HTMLGenerator startTag(String tag)
HTMLGenerator startTableCol(String attributes)
HTMLGenerator startTable(String attributes)
Here is the call graph for this function:

The documentation for this class was generated from the following file: