MCPcopy Create free account
hub / github.com/xmlet/HtmlFlow / HtmlTables

Class HtmlTables

htmlflow-core/src/test/java/htmlflow/test/views/HtmlTables.java:39–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37import java.util.function.BiConsumer;
38
39public class HtmlTables {
40
41 public static void simpleTableView(HtmlPage view){
42 view
43 .html()
44 .head()
45 .title().text("Dummy Table")
46 .__()// title
47 .__()// head
48 .body()
49 .h1().text("Dummy Table").__()
50 .hr().__()
51 .div()
52 .table()
53 .tr()
54 .th().text("Id1").__()
55 .th().text("Id2").__()
56 .th().text("Id3").__()
57 .__() //tr
58 .<int[][]>dynamic((table, outputRows) -> {
59 for (int[] outputRow : outputRows) {
60 table.tr()
61 .of(tr -> {
62 for (int rowValue : outputRow) {
63 tr.td()
64 .text("" + rowValue)
65 .__();
66 }
67 }).__();
68 }
69 })
70 .__()
71 .__()
72 .__()
73 .__();
74 }
75
76 /**
77 * An example of a dynamic view with an Iterable<Task> as domain model and
78 * an array with two partial views: a div heading and table row.
79 */
80 public static HtmlTemplate taskListViewWithPartials(BiConsumer<Tbody<?>, Task> partial) {
81 return view -> view
82 .html()
83 .head()
84 .title()
85 .text("Task List")
86 .__()
87 .link()
88 .attrRel(EnumRelType.STYLESHEET)
89 .attrType(EnumTypeContentType.TEXT_CSS)
90 .attrHref("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css")
91 .__()
92 .__()
93 .body()
94 .attrClass("container")
95 .of(ignore -> // ignore body argument because we don't need it here
96 HtmlTables.taskListViewHeader(view)

Callers

nothing calls this directly

Calls 7

viewMethod · 0.95
__Method · 0.80
trMethod · 0.80
tbodyMethod · 0.80
getEmailMethod · 0.80
htmlMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected