TBODY<TABLE<Hamlet>> tbody = html. h2("All Containers:"). table("#Containers"). thead("ui-widget-header"). tr(). tbody._()._().div().$style("margin:20px 2px;")._(" ")._(). h2("View Board:"). table("#Board"). thead("ui-widget-header"). tr(). _()._()._(); } else { tbody._()._().div().$style("margin:20px 2px;")._(" ")._(). h2("View Board:"). table("#Board"). thead("ui-widget-header"). tr(). TBODY<TABLE<Hamlet>> tbodySave = html. h2(""). table("#savedmodel"). thead("ui-widget-header"). tr(). TBODY<TABLE<Hamlet>> resourceAppliedInfo = html. h2("Resource Applied Info:"). table("#resourceAppliedInfo").
@Override public Hamlet h1(String selector, String cdata) { return setSelector(h1(), selector)._(cdata)._(); }
@Override public Hamlet link(String href) { return setLinkHref(link(), href)._(); }
@Override public DIV<Hamlet> div(String selector) { return setSelector(div(), selector); }
@Override public P<Hamlet> p(String selector) { return setSelector(p(), selector); }
@Test public void testEnumAttrs() { Hamlet h = newHamlet(). meta_http("Content-type", "text/html; charset=utf-8"). title("test enum attrs"). link().$rel("stylesheet"). $media(EnumSet.of(Media.screen, Media.print)). $type("text/css").$href("style.css")._(). link().$rel(EnumSet.of(LinkType.index, LinkType.start)). $href("index.html")._(); h.div("#content")._("content")._(); PrintWriter out = h.getWriter(); out.flush(); assertEquals(0, h.nestLevel); verify(out).print(" media=\"screen, print\""); verify(out).print(" rel=\"start index\""); }
@Test public void testTable() { Hamlet h = newHamlet(). title("test table"). link("style.css"); TABLE t = h.table("#id"); for (int i = 0; i < 3; ++i) { t.tr().td("1").td("2")._(); } t._(); PrintWriter out = h.getWriter(); out.flush(); assertEquals(0, h.nestLevel); verify(out).print("<table"); verify(out).print("</table>"); verify(out, atLeast(1)).print("</td>"); verify(out, atLeast(1)).print("</tr>"); }
protected void doRender(Hamlet html) { html. div("cluster_json"). h2("JSON Cluster Specification"). pre(). _(getJson())._()._(); }
@Override protected void render(Block html) { TBODY<TABLE<Hamlet>> tbody = html. h2("Retired Jobs"). table("#jobs"). thead(). tr().
@Test public void testSubViews() { Hamlet h = newHamlet(). title("test sub-views"). div("#view1")._(TestView1.class)._(). div("#view2")._(TestView2.class)._(); PrintWriter out = h.getWriter(); out.flush(); assertEquals(0, h.nestLevel); verify(out).print("["+ TestView1.class.getName() +"]"); verify(out).print("["+ TestView2.class.getName() +"]"); }
@Override public TABLE<Hamlet> table(String selector) { return setSelector(table(), selector); }
name = "'" + name + "'"; DIV<Hamlet> div = html.div("general_info") .h1("index_header", "Application: " + name); DIV<Hamlet> containers = html.div("container_instances") .h3("Component Instances"); DIV<Hamlet> diagnostics = html.div("diagnostics"); DIV<Hamlet> provider_info = html.div("provider_info"); provider_info.h3(providerName + " information"); UL<Hamlet> ul = html.ul(); addProviderServiceOptions(providerService, ul, clusterStatus); ul._(); provider_info._(); DIV<Hamlet> exports = html.div("exports"); exports.h3("Exports"); ul = html.ul(); enumeratePublishedExports(appState.getPublishedExportsSet(), ul); ul._(); exports._(); DIV<Hamlet> appDiagnosticsDiv = html.div("app_diagnostics") .h3("Application Container Diagnostics");
@Test public void testScriptStyle() { Hamlet h = newHamlet(). script("a.js").script("b.js"). style("h1 { font-size: 1.2em }"); PrintWriter out = h.getWriter(); out.flush(); assertEquals(0, h.nestLevel); verify(out, times(2)).print(" type=\"text/javascript\""); verify(out).print(" type=\"text/css\""); }
@Override protected void render(Block html) { html.link(root_url("static/jquery/themes-1.9.1/base/jquery-ui.css")) .link(root_url("static/dt-1.9.4/css/jui-dt.css")) .script(root_url("static/jquery/jquery-1.8.2.min.js")) .script(root_url("static/jquery/jquery-ui-1.9.1.custom.min.js")) .script(root_url("static/dt-1.9.4/js/jquery.dataTables.min.js")) .script(root_url("static/yarn.dt.plugins.js")) .script(root_url("static/dt-sorting/natural.js")) .style("#jsnotice { padding: 0.2em; text-align: center; }", ".ui-progressbar { height: 1em; min-width: 5em }"); // required List<String> list = Lists.newArrayList(); initAccordions(list); initDataTables(list); initDialogs(list); initProgressBars(list); if (!list.isEmpty()) { html.script().$type("text/javascript")._("$(function() {") ._(list.toArray())._("});")._(); } }
@Override public Hamlet script(String src) { return setScriptSrc(script(), src)._(); }
@Override public Hamlet title(String cdata) { return title()._(cdata)._(); }
@Override public Hamlet style(Object... lines) { return style().$type("text/css")._(lines)._(); }
@Override public Hamlet h1(String cdata) { return h1()._(cdata)._(); }