private void prependBreadcrumb(Element span, Element breadcrumb) { if (span.hasChildren()) { span.prependText(" "); } span.prependText(" >"); span.prependChild(breadcrumb); }
private void prependBreadcrumb(Element span, Element breadcrumb) { if (span.hasChildren()) { span.prependText(" "); } span.prependText(" >"); span.prependChild(breadcrumb); }
private void ensureDocumentHasTogglingScript(Element element) { Element rootElement = element.getRootElement(); if (!rootElementsWithScript.contains(rootElement)) { rootElementsWithScript.add(rootElement); Element head = rootElement.getFirstDescendantNamed("head"); if (head == null) { System.out.println(rootElement.toXML()); } Check.notNull(head, "Document <head> section is missing"); if (head != null) { Element script = new Element("script").addAttribute("type", "text/javascript"); head.prependChild(script); script.appendText(resourceSource.readResourceAsString(TOGGLING_SCRIPT_RESOURCE_PATH)); } } }
private void ensureDocumentHasTogglingScript(Element element) { Element rootElement = element.getRootElement(); if (!rootElementsWithScript.contains(rootElement)) { rootElementsWithScript.add(rootElement); Element head = rootElement.getFirstDescendantNamed("head"); if (head == null) { System.out.println(rootElement.toXML()); } Check.notNull(head, "Document <head> section is missing"); if (head != null) { Element script = new Element("script").addAttribute("type", "text/javascript"); head.prependChild(script); script.appendText(resourceSource.readResourceAsString(TOGGLING_SCRIPT_RESOURCE_PATH)); } } }
public void afterProcessingSpecification(SpecificationProcessingEvent event) { try { Element span = new Element("span").addStyleClass("breadcrumbs"); appendBreadcrumbsTo(span, event.getResource()); if (span.hasChildren()) { getDocumentBody(event.getRootElement()) .prependChild(span); } } catch (Throwable t) { t.printStackTrace(); } }
public void afterProcessingSpecification(SpecificationProcessingEvent event) { try { Element span = new Element("span").addStyleClass("breadcrumbs"); appendBreadcrumbsTo(span, event.getResource()); if (span.hasChildren()) { getDocumentBody(event.getRootElement()) .prependChild(span); } } catch (Throwable t) { t.printStackTrace(); } }
public static void setupCommandForExample(CommandCall node, ResultRecorder resultRecorder, String exampleName) { node.getElement().addAttribute("id", exampleName); // let's be really nice and add the implementation status text into the element itself. ImplementationStatusChecker checker = ImplementationStatusChecker.implementationStatusCheckerFor(resultRecorder.getImplementationStatus()); Element fixtureNode = new Element("p"); fixtureNode.appendText(checker.printNoteToString()); node.getElement().prependChild(fixtureNode); }
public static void setupCommandForExample(CommandCall node, ResultRecorder resultRecorder, String exampleName) { node.getElement().addAttribute("id", exampleName); // let's be really nice and add the implementation status text into the element itself. ImplementationStatusChecker checker = ImplementationStatusChecker.implementationStatusCheckerFor(resultRecorder.getImplementationStatus()); Element fixtureNode = new Element("p"); fixtureNode.appendText(checker.printNoteToString()); node.getElement().prependChild(fixtureNode); }