@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(); } }
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); }
private HtmlCanvas generateSample(String title, String sample) throws IOException { HtmlCanvas html = new HtmlCanvas(); this.project.getProperties().put("data-clipboard-text", sample.replace("\n", "
")); this.project.getProperties().put("config-title", title); String templateStart = replaceProperties(replaceProperties("${configTextStart}")); String templateEnd = replaceProperties(replaceProperties("${configTextEnd}")); html.write(templateStart, false); html. pre(class_("xml")). write(sample, false) ._pre(); html.write(templateEnd, false); return html; }
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
@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 static void toTop() throws IOException { html.p(class_("totop")).a(href("#top")).content("Back to Top")._p(); }
private static void toTestClass(String name) throws IOException { html.p(class_("totest")).a(href("#" + name)) .content("Back to Main Test Class")._p(); }
private void toTop() throws IOException { html.p(class_("totop")).a(href("#top")).content("Back to Top")._p(); } private void writeOverallBarChart() throws IOException {
@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 updateTop(MavenProject project, HtmlCanvas html, boolean last, boolean nextIsEmpty) throws IOException { if (project == null) return; SiteTop siteTop = new SiteTop(project); updateTop(project.getParent(), html, false, siteTop.caption.isEmpty()); html.render(siteTop); if (!last && !nextIsEmpty) { html .span(class_("brand") ) .write("/") ._span() ; } }
@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 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())); }
private void updateMenu(File htmlFile, List<SubMenuReplacement> subMenuReplacements) throws IOException, MojoExecutionException { if (subMenuReplacements == null || subMenuReplacements.isEmpty()) return; for (SubMenuReplacement subMenuReplacement : subMenuReplacements) { HtmlCanvas html = new HtmlCanvas(); html .li(class_("dropdown-submenu")) .a(href(subMenuReplacement.getOriginalMenuElementLink())).write(subMenuReplacement.getOriginalMenuElement())._a() .ul(class_("dropdown-menu")); if (subMenuReplacement.getSubMenuElements() != null) { for (String subMenuElement : subMenuReplacement.getSubMenuElements().keySet()) { html.render(new SubMenuElement(subMenuElement, subMenuReplacement.getSubMenuElements().get(subMenuElement))); } } html ._ul() ._li(); replaceByLine(htmlFile, "<li.*><a href=.*>" + subMenuReplacement.getOriginalMenuElement() + "</a></li>", formatHtml(html.toHtml())); } }
private void generateSummaryTableStart(Date date, String suiteName) throws IOException { html.tr().th().content("Test Suite Name"); html.th().content("Revision"); html.th().content("Report Date"); html.th().content("Skipped Tests"); html.th().content("MUST Requirements"); html.th().content("SHOULD Requirements"); html.th().content("MAY Requirements"); html._tr(); html.tr(class_("alt")).td().content(suiteName); final String commit = BuildProperties.getRevision(); if (commit == null) { html.td().content("<UNKNOWN>"); } else { html.td().a(href("https://github.com/w3c/ldp-testsuite/commit/" + commit)).content(commit)._td(); } html.td().content(date.toString()); }
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; }