Package org.thymeleaf.dom

Examples of org.thymeleaf.dom.Element.addChild()


    Element thead = DomUtils.findElement((Element) tableNode, "thead");
   
    Element tr = new Element("tr");
    for(HtmlColumn column : table.getLastHeaderRow().getColumns()){
      Element th = new Element("th");
      th.addChild(new Text(column.getContent().toString()));
      tr.addChild(th);
    }

    if(thead != null){
      thead.addChild(tr);
View Full Code Here


    Node tableNode = (Node) ((IWebContext) arguments.getContext()).getHttpServletRequest().getAttribute(DataTablesDialect.INTERNAL_NODE_TABLE);
   
    for(HtmlColumn column : table.getLastHeaderRow().getColumns()){
      Element th = new Element("th");
      th.addChild(new Text(column.getContent().toString()));
      tfoot.addChild(th);
    }

    ((Element) tableNode).addChild(tfoot);
  }
View Full Code Here

       
        final org.w3c.dom.NodeList children = domNode.getChildNodes();
        final int childrenLen = children.getLength();
        for (int i = 0; i < childrenLen; i++) {
            final org.w3c.dom.Node child = children.item(i);
            element.addChild(translateNode(child, element, documentName));
        }
       
        return element;
       
    }
View Full Code Here

    // Replace the children of this element with those of the include page fragments.
    element.clearChildren();
    if (includefragments != null) {
      Element containerelement = new Element("container");
      for (Node includefragment: includefragments) {
        containerelement.addChild(includefragment);
        containerelement.extractChild(includefragment);
      }
      for (Node extractedchild: containerelement.getChildren()) {
        element.addChild(extractedchild);
      }
View Full Code Here

        final Element containerElement = new Element("container");

        for (final Node extractedNode : extractedNodes) {
            // This is done in this indirect way in order to preserver internal structures like e.g. local variables.
            containerElement.addChild(extractedNode);
            containerElement.extractChild(extractedNode);
        }

        final List<Node> extractedChildren = containerElement.getChildren();
        containerElement.clearChildren();
View Full Code Here

        if (script == null) {
            script = new Element("script");
            script.setAttribute("type", "text/javascript");
            script.setAttribute("id", blockId);
            String text = "\n//<![CDATA[\n" + eventDeclaration + "(function(){\n});\n//]]>\n";
            script.addChild(new Text(text, false));
            DomUtils.getElementsByTagName(document, "body").get(0).addChild(script);
        }
        // Build indented code
        StringBuilder codeSb = new StringBuilder();
        StringTokenizer lines = new StringTokenizer(code, "\n");
View Full Code Here

                String tabId = DomUtils.getOrCreateId(arguments.getDocument(), div, "tab-");
                // Build li element
                Element li = new Element("li");
                Element a = new Element("a");
                a.setAttribute("href", "#" + tabId);
                a.addChild(new Text(tabTitle));
                li.addChild(a);
                ul.addChild(li);
                // Add next event
                addNextTab(div, tabContainerId);
            }
View Full Code Here

        String anchorTitle = JsDialectUtil.templateMessage(arguments, messageTipKey);
        anchor.setAttribute("title", anchorTitle);
        Element span = new Element("span");
        String messageKey = label;
        String buttonText = JsDialectUtil.templateMessage(arguments, messageKey);
        span.addChild(new Text(buttonText));
        anchor.addChild(span);
        element.addChild(anchor);
    }

    private void addPaginationDiv() {
View Full Code Here

        String tabId = DomUtils.getOrCreateId(document, element, "tab-");
        // Build li element
        Element li = new Element("li");
        Element a = new Element("a");
        a.setAttribute("href", "#" + tabId);
        a.addChild(new Text(tabTitle));
        li.addChild(a);
        // Add li element to tabContainer
        tabContainer.getFirstElementChild().addChild(li);
    }
View Full Code Here

    /** Adds a separator among links for accesibility. */
    private void addSeparator() {
        Element span = new Element("span");
        span.setAttribute("class", "linkSeparator");
        span.addChild(new Text("|"));
        element.addChild(span);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.