@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 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 renderOn(HtmlCanvas html) throws IOException { if (caption == null || caption.trim().isEmpty()) return; html .a(class_("brand").href(link)) .write(caption, false) ._a(); } }
private void makeIndirectSummaryTable() throws IOException { html.table(class_("indented")); html.tr().th().a(id(("Indirect"))).write("Indirectly Tested Test Cases")._a()._th(); html.th().content("Overall Test Result"); html.th().content("Description of Test Method")._tr(); method.getTestClass().getName(), method.getMethodName()); html.td() .a(href("#" + method.getTestClass().getName() + "_" + method.getMethodName())).write(normalizedName)._a()._td(); ArrayList<String> result = new ArrayList<String>(); html.td(class_("Failed")).content(FAIL); else if(result.contains(PASS) && !result.contains(FAIL)) html.td(class_("Passed")).content(PASS); else if(result.contains(SKIP) && !result.contains(FAIL) && !result.contains(PASS)) html.td(class_("Skipped")).content(SKIP);
@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")) .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(); }
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() ._div() ._nav() .div(class_("container")); html.write(description.getName()); html._h3(); html.h4().write("URI: ").a(href(description.getUri().toString())).content(description.getUri().toString())._h4(); html.h4().write("Description: ").write(description.getDescription())._h4(); if (description instanceof DataSourceDescriptionHtml) {
@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(); } }
html.table(class_("summary")); html.tr().th().content("Totals"); html.th().content("Coverage"); html.td(rowspan("2")).b().write("" + totalTests)._b().write(" Total Tests"); html.ul(); html.br().b().a(href("#tobeapproved")).write(readyToBeApproved.size() + " Ready for Approval")._a()._b(); html.span(class_("chartStart")); html.div(class_("barChart").id("overall_statusbar"))._div(); generateStatusGraphJSON("overall", approve, pend, extnd, deprctd, clarify); html._span(); html.b().write(indirectCases.size())._b().write(" Tests ").a(href(("#indirectCases"))).write("Indirectly Covered")._a(); .a(href("#needCode")).write("Yet to be Coded")._a()._li(); writeColorBlock(implmColor, "client"); html.b().write(clients.size() + " ")._b().write("of the Total are ") .a(href("#clientTests")).write("Client-Based Tests")._a(); html._li(); writeColorBlock(implmColor, "manual"); html.b().write(manuals.size() + " ")._b().write("of the Total must be ") .a(href("#manualTests")).write("Tested Manually")._a(); html._li();
/** * Write the link tag with a reference to the favicon. * @param iconHref * @return the canvas * @throws IOException */ public T favicon(String iconHref) throws IOException { return (T)canvas .link(href(iconHref) .rel("shortcut icon")); } }
@SuppressWarnings("unchecked") protected void writeSummary() throws IOException { html.h2(id("tobeapproved")).content("Test Cases Ready for Approval"); } else { html.p().write("For details of test cases, ") .a(href("https://github.com/w3c/ldp-testsuite")) .write("see source in GitHub")._a()._p(); html.ul(); html.h2(id("needCode")).content("Test Cases Yet to be Implemented"); if (needCode.size() == 0) html.b().write("No test cases that need to be Implemented")._b() html.h2().a(id("indirectCases")).content("Test Cases Covered Indirectly")._h2(); writeIndirectCases(); html.h2().a(id("manualTests")) .content("Tests that Must be Tested Manually")._h2(); generateList(manuals); html.h2().a(id("clientTests")).content("Client-Based Test Cases")._h2(); generateList(clients);
@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(); }
/** * Render the receiver on a html to provide debugging information about the exception. */ public void renderOn(HtmlCanvas html) throws IOException { html.div(style("color:red")); if (isEmptyStack) { html.write("[Render Error] unexpected close()"); return; } if (expectedTag != null) { // tag mismatch html.write(String.format("[Render Error] expected [%s] actual [%s]", expectedTag, closingTag)); } if (exception != null) { // general error html.write(String.format("[Render Error] general exception [%s]", exception.getMessage())); } // if debugging, the error component is available Renderable errorComponent = (Renderable)(html.getPageContext().getObject("renderable.error")); if (errorComponent != null) { html.write(" in ").write(errorComponent.getClass().getName()); } else { html.a(href("?inspect")).write(" Inspect details")._a(); this.renderStackTraceOn(html); } html._div(); } /**
private <T> void writeTestCasesForClass(Class<T> classType) throws IOException, SecurityException { String className = classType.getCanonicalName(); html.h2().a(id(className)).write("Test Class: " + className)._a()._h2(); html.ul(); for (Method method : classType.getDeclaredMethods()) { if (method.isAnnotationPresent(Test.class)) { writeTestCaseDetails(method, className); } } html._ul(); toTop(); }
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(); }
/** * Render error reporting information using the (debug) html * @param html * @throws IOException */ public void renderForErrorOn(HtmlCanvas html) throws IOException { html.h3().write(this.getClass().getName())._h3(); html.table(border("1px").cellpadding("4px")); for (String key : attributes.keySet()) { Object value = attributes.get(key); html .tr() .td().write(key)._td() .td().write(value.toString())._td() ._tr(); } html._table(); } @Override
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; }
private HtmlCanvas generateGlobalParametersSection(HtmlCanvas html) throws IOException { html. div(class_("section")). 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.div(class_(clazz));//.p().write("TEST")._p()._div(); html.h4().write(globalParameter.category)._h4(); html.div(class_(clazz)); // todo : manage uncategorized with hasAtLeastOneNotGuessedProperty html.h4().write("Uncategorized")._h4(); html.table(border("0").class_("bodyTable table table-striped table-hover")). thead(). tr(class_("a")). th().write("Property")._th().