public class Logo implements Renderable { public void renderOn(HtmlCanvas html) throws IOException { //@formatter:off html .div(id("logo")) .div(id("logo_text")) .h1() .a(href("index.html")) .write("render") .style().write(".snake { color:yellow; }")._style() .span(class_("snake")).write("S")._span() .write("nake") ._a() ._h1()._div() ._div(); } }
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(); }
@Override public HtmlCanvas getContent(HtmlCanvas html) throws IOException, SAXException { html. div(class_("row")). div(class_("span12")). div(class_("body-content")). div(class_("section")). div(class_("page-header")). h2(id(packagingName + "-packaging")).write(packagingName + " packaging")._h2(). p().write("This is the packaging for " + packagingName + ".")._p() ._div() ._div() ._div() ._div() ._div(); return html; } };
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); }
public void renderOn(HtmlCanvas html) throws IOException {// @formatter:off // no need to inspect an exception if (target instanceof RenderException) { target.renderOn(html); return; } html .div(class_("rendersnake-inspector")) .write(target.getClass().getName()); html.getPageContext().renderForInpectorOn(this,html); target.renderOn(html); html._div(); } // @formatter:on
private HtmlCanvas getLifecyclesDocumentation(HtmlCanvas html) throws IOException { html. div(class_("row")). div(class_("span12")). div(class_("body-content")). div(class_("section")). div(class_("page-header")). h2(id("Lifecycles")).write("Lifecycles")._h2(). p().write("The different lifecycles of the plugin are associated with custom packagings.")._p(); html.render(new Renderable() { @Override public void renderOn(HtmlCanvas html) throws IOException { getLifecyclesSection(html); } }); html ._div() ._div() ._div() ._div() ._div(); return html; }
private HtmlCanvas getArchetypeSection() throws IOException { HtmlCanvas html = new HtmlCanvas(); html.div(class_("section")). div(class_("page-header")). h2(id("Archetype")).em().write(project.getArtifactId())._em().write(" archetype")._h2() ._div(). a(name("Archetype"))._a(); String additionalHTML = replaceProperties(getPropertyValue(project, "archetypeAdditionalHTML", false, false, false)); if (additionalHTML != null && ! additionalHTML.isEmpty()) { html.write(additionalHTML, false); } Dependency dependency = new Dependency(); dependency.setGroupId(project.getGroupId()); dependency.setArtifactId(project.getArtifactId()); dependency.setVersion(project.getVersion()); String archetypeAdditionalArguments = replaceProperties(project.getProperties().getProperty("archetypeAdditionalArguments")); HtmlCanvas commandLine = createArchetypesCommandLines(dependency, archetypeAdditionalArguments, false); html.write(commandLine.toHtml(), false) ._div(); return html; }
@Override public void processHTMLFile(File htmlFile) throws Exception { HtmlCanvas html = new HtmlCanvas(); html .div(class_("brand")); updateTop(project, html, true, false); html ._div(); replaceByLine(htmlFile, "<div class=\"brand\".*</div>", formatHtml(html.toHtml())); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container")) .div(class_("row")) .div(class_("col-lg-12")) .h3() .write("Script ") .small().content(String.format("%s -> %s", fSrc.getName(), fDst.getName())) ._h3() .pre().content(ActionsIoUtils.toText(src, this.script, mappings).toString()) ._div() ._div() ._div() .render(new BootstrapFooterView()) .macros().javascript("/dist/script.js") ._body() ._html(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container")) .div(class_("row")) .div(class_("col-lg-12")) .h3() .write("Script ") .small().content(String.format("%s -> %s", fSrc.getName(), fDst.getName())) ._h3() .pre().content(ActionsIoUtils.toText(src, this.script, mappings).toString()) ._div() ._div() ._div() .render(new BootstrapFooterView()) .macros().javascript("/dist/script.js") ._body() ._html(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container-fluid")) .div(class_("row")) .render(new MenuBar()) ._div() .div(class_("row")) .div(class_("col-lg-6 max-height")) .h5().content(fSrc.getName()) .pre(class_("pre max-height")).content(diffs.getSrcDiff(), false) ._div() .div(class_("col-lg-6 max-height")) .h5().content(fDst.getName()) .pre(class_("pre max-height")).content(diffs.getDstDiff(), false) ._div() ._div() ._div() .render(new BootstrapFooterView()) .macros().javascript("/dist/diff.js") ._body() ._html(); }
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); }
@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(); } }
@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(); } }
private void generateList(String[] list, String title) throws IOException { html.h2().write(title)._h2(); if (list.length == 0) { html.div(style("padding-left:2em")).i() .content("No groups of this type found in the test suite") ._div(); } else { html.ul(); for (String group : list) { html.li().content(group); } html._ul(); } }
@SuppressWarnings("unchecked") protected void generateHTMLReport() throws IOException, SecurityException { html = new HtmlCanvas(); html.html().head(); writeCss(); html.title().content(title + ": Test Cases Coverage Report")._head().body(); html.h1().content("W3C Linked Data Platform (" + title + ") Test Suite: Test Cases Coverage Report"); html.p().a(href("http://www.w3.org/2012/ldp/")).content("See also W3C Linked Data Platform WG")._p(); html.p().a(href(specUri)).content("Specification Requirements Page")._p(); final String commit = BuildProperties.getRevision(); if (commit != null) { html.div() .write("Test Suite Revision: ") .a(href("https://github.com/w3c/ldp-testsuite/commit/" + commit)).content(commit)._div(); } DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.ENGLISH); html.div().content("Updated: " + dateFormat.format(new Date())); // Generate the summary diagrams and information createSummaryReport(); toTop(); // Go through all the classes and generate details of each test case for (@SuppressWarnings("rawtypes") Class testcaseClass: testClasses) { writeTestCasesForClass(testcaseClass); } }
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); }
private HtmlCanvas generateSampleProfileDocumentation(HtmlCanvas html) throws IOException { HtmlCanvas sampleProfile = new HtmlCanvas(); sampleProfile = generateSampleProfile(sampleProfile); html. div(class_("section")). h3(id("Sample_Profile")).write("Sample Profile")._h3(). p().em().write("Based on above properties, here is a sample profile to include in ").a(href("https://maven.apache.org/settings.html")).write("Maven settings.xml file")._a().write(":")._em()._p(). write(sampleProfile.toHtml(), false). write(sampleProfileCommandLineGenerator, false) ._div(); addPropertyInSessionRequest("sampleProfile", sampleProfile.toHtml()); return html; }
@Override public void renderOn(HtmlCanvas html) throws IOException { html. div(class_("section")). h3(id("Lifecycle_"+this.getPackagingName())).a(href("packaging-"+this.getPackagingName()+".html")).write(this.getPackagingName())._a()._h3(). table(border("0").class_("bodyTable table table-striped table-hover")). thead(). tr(class_("a")). th().write("Phase")._th(). th().write("Goal")._th(). _tr() ._thead(). tbody(); for (t3.LifecyclesUtils.Phase phase : this.getPhases()) { ((Phase) phase).renderOn(html); } html ._tbody() ._table() ._div(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .head() .meta(charset("utf8")) .meta(name("viewport").content("width=device-width, initial-scale=1.0")) .title().content("GumTree") .macros().javascript("/dist/jquery.min.js") .macros().javascript("/dist/codemirror.min.js") .macros().stylesheet("/dist/codemirror.css") .macros().javascript("/dist/mergely.min.js") .macros().javascript("/dist/mergely_shortcuts.js") .macros().stylesheet("/dist/mergely.css") .macros().stylesheet("/dist/mergely_custom.css") ._head() .body() .div(id("compare")) ._div() .macros().script("lhs_url = \"/left/" + id + "\";") .macros().script("rhs_url = \"/right/" + id + "\";") .macros().javascript("/dist/mergely_ajax.js") ._body() ._html(); } }