/** * @param type * @return */ public static HtmlAttributes dataType(String type) { return new HtmlAttributes().add("data-type", type); }
private HtmlAttributes getClass(String cssClassName) { return new HtmlAttributes().class_(cssClassName); }
/** * If condition is true then add the attribute selected with value "selected". * @param condition * @return a HtmlAttributes */ public static HtmlAttributes selected_if(boolean condition) { return new HtmlAttributes().selected_if(condition); } /**
/** * If condition is true then add the attribute autofocus with value "autofocus". * @param condition * @return a HtmlAttributes */ public static HtmlAttributes autofocus_if(boolean condition) { return new HtmlAttributes().autofocus_if(condition); } /**
void generateHeader(HtmlCanvas reportPageBody, String cloudSlangImage) throws IOException { HtmlCanvas headerDiv = reportPageBody.div(new HtmlAttributes().id(HEADER_BAR_ID)); HtmlCanvas anchor = headerDiv.a(new HtmlAttributes().href(HTTP_CLOUD_SLANG_IO).target(BLANK)); HtmlCanvas img = new HtmlCanvas().img(new HtmlAttributes().src(cloudSlangImage).alt(CLOUD_SLANG_LOGO_ALT)); anchor.content(img.toHtml(), false); headerDiv._div(); reportPageBody.h1(new HtmlAttributes().class_(REPORT_TITLE_CLASS)).content(TEST_CASE_REPORT); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .div(class_("col-lg-12")) .div(class_("btn-toolbar pull-right")) .div(class_("btn-group")) .a(class_("btn btn-default btn-xs").id("legend").href("#").add("data-toggle", "popover").add("data-html", "true").add("data-placement", "bottom").add("data-content", "<span class="del"> </span> deleted<br><span class="add"> </span> added<br><span class="mv"> </span> moved<br><span class="upd"> </span> updated<br>", false).add("data-original-title", "Legend").title("Legend").role("button")).content("Legend") .a(class_("btn btn-default btn-xs").id("shortcuts").href("#").add("data-toggle", "popover").add("data-html", "true").add("data-placement", "bottom").add("data-content", "<b>q</b> quit<br><b>l</b> list<br><b>n</b> next<br><b>t</b> top<br><b>b</b> bottom", false).add("data-original-title", "Shortcuts").title("Shortcuts").role("button")).content("Shortcuts") ._div() .div(class_("btn-group")) .a(class_("btn btn-default btn-xs btn-danger").href("/quit")).content("Quit") ._div() ._div() ._div(); } }
/** * Append the <em>cols</em> attribute with the given Integer parameter as its value. * * @param cols the Integer | null. * @return the receiver, this <code>HtmlAttributes</code> instance. * @since HTML4.01 */ public HtmlAttributes cols(Integer cols) { return this.add("cols", cols); } /**
private void generatePiechart(HtmlCanvas reportPageBody, IRunTestResults iRunTestResults) throws IOException { HtmlCanvas divSummary = reportPageBody.div(); divSummary.div(new HtmlAttributes().id(PIECHART_ID))._div(); HtmlCanvas divTestSummary = divSummary.div(new HtmlAttributes().class_(TEST_SUMMARY_CLASS)); int passedCount = iRunTestResults.getPassedTests().size(); int skippedCount = iRunTestResults.getSkippedTests().size(); int failedCount = iRunTestResults.getFailedTests().size(); divTestSummary.h2().content(format(PASSED_TESTS, passedCount)); divTestSummary.h2().content(format(FAILED_TESTS, failedCount)); divTestSummary.h2().content(format(SKIPPED_TESTS, skippedCount)); divTestSummary._div(); divSummary._div(); // Hidden divs used to be able to link data to piechart.js reportPageBody.div(new HtmlAttributes().id(PASSED.toLowerCase(ENGLISH)) .class_(HIDDEN_CLASS)).content(passedCount); reportPageBody.div(new HtmlAttributes().id(FAILED.toLowerCase(ENGLISH)) .class_(HIDDEN_CLASS)).content(failedCount); reportPageBody.div(new HtmlAttributes().id(SKIPPED.toLowerCase(ENGLISH)) .class_(HIDDEN_CLASS)).content(skippedCount); }
/** * Write a link reference to load the external Javascript library for * JQuery. This should be part of the HEAD section of an HTML page. * * @param html */ public void renderOn(HtmlCanvas html) throws IOException { if (url.endsWith(".js")) { html.script(html.attributes().type("text/javascript").src(url))._script(); return; } if (url.endsWith(".css")) { html.link(html.attributes().type("text/css").href(url).rel("stylesheet")); return; } throw new IllegalStateException("Unknown resource type:" + url); } }
@Override public void renderOn(HtmlCanvas html) throws IOException { if (caption == null || caption.trim().isEmpty()) return; html .a(class_("brand").href(link)) .write(caption, false) ._a(); } }
h3(id("Global_Parameters")).write("Global Parameters")._h3(). p().em().write("By default, only parameters which cannot be guessed are displayed. ")._em(). a(href("#").id("toggleGuessed")).write("Show other parameters")._a().write(" to customize default values.")._p(); html.table(border("0").class_("bodyTable table table-striped table-hover")). thead(). tr(class_("a")).
private static <T> void writeTestClassTable(Class<T> classType) throws IOException { html.span(class_("chartStart")); html.label(class_("label")).b().write("Test Case Status")._b()._label(); html.div(class_("smallBar").id(classType.getSimpleName() + "_statusbar"))._div(); writeStatusLegend(); html.span(class_("chartStart")); html.label(class_("label")).b().write("Test Case Implementation")._b()._label(); html.div(class_("smallBar").id(classType.getSimpleName() + "_implmtbar"))._div(); writeImplmntLegend(); acquireTestInfo(classType); }
html.span(class_("chartStart")); html.div(class_("barChart").id("overall_statusbar"))._div(); generateStatusGraphJSON("overall", approve, pend, extnd, deprctd, clarify); html._span(); html._tr(); html.tr().td(colspan("2").style("text-align:center;")); html.span(class_("chartStart")); html.div(class_("barChart").id("overall_implmtbar"))._div(); writeImplementationGraph("overall", auto, unimplmnt, client, manual, indirect); html._span();
@Override public void renderOn(HtmlCanvas html) throws IOException { html .head() .meta(charset("utf8")) .meta(name("viewport").content("width=device-width, initial-scale=1.0")) .title().content("GumTree") .macros().stylesheet("/dist/bootstrap.min.css") .macros().stylesheet("/dist/gumtree.css") ._head(); }
private static void writeColorBlock(HashMap<String, String> list, String string) throws IOException { // TODO: Create a class for this style in our stylesheet. html.div(style("background-color:" + list.get(string) + ";").class_("color-block"))._div(); }
/** * If condition is true then add the attribute checked with value "checked". * @param condition * @return a HtmlAttributes */ public static HtmlAttributes checked__if(boolean condition) { return new HtmlAttributes().checked_if(condition); } /**
/** * If condition is true then add the attribute disabled with value "disabled". * @param condition * @return a HtmlAttributes */ public static HtmlAttributes disabled_if(boolean condition) { return new HtmlAttributes().disabled_if(condition); } /**
/** * If condition is true then add the attribute required with value "required". * @param condition * @return a HtmlAttributes */ public static HtmlAttributes required_if(boolean condition) { return new HtmlAttributes().required_if(condition); }
html .head() .meta(name("viewport").content("width=device-width, initial-scale=1")) .macros().javascript("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js") .macros().stylesheet("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css") ._head() .body() .nav(class_("navbar navbar-inverse navbar-fixed-top").style("background:#0A3F54")) .div(class_("container")) .div(class_("navbar-header")) .a(class_("navbar-brand").style("color:white;")) .content("StreamPipes Pipeline Element Container") ._div()