Package org.thymeleaf.dom

Examples of org.thymeleaf.dom.Node


  }
 
  @Override
  protected void adaptHeader(HtmlTable table) {
   
    Node tableNode = (Node) ((IWebContext) arguments.getContext()).getHttpServletRequest().getAttribute(DataTablesDialect.INTERNAL_NODE_TABLE);
    Element thead = DomUtils.findElement((Element) tableNode, "thead");
   
    Element tr = new Element("tr");
    for(HtmlColumn column : table.getLastHeaderRow().getColumns()){
      Element th = new Element("th");
View Full Code Here


  @Override
  protected void adaptFooter(HtmlTable table) {
   
    Element tfoot = new Element("tfoot");

    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);
View Full Code Here

    try {
      NestableNode parent = element.getParent();
      parent.removeChild(element);
      ((AbstractGeneralTemplateWriter) templateWriter).writeNode(arguments, writer, parent);

      Node content = new Macro(writer.toString());
      CacheManager.put(arguments, cacheName, Collections.singletonList(content));
    } catch (IOException e) {
      throw new TemplateOutputException("Error during creation of output", e);
    }
    return ProcessorResult.OK;
View Full Code Here

       
        final NestableNode parentNode = element.getParent();

        // Find out if there's some whitespace to duplicate so as to preserve the
        // 'look' of the HTML code when completed
        Node previousNode = null;
        for (final Node child: parentNode.getChildren()) {
            if (child == element) {
                break;
            }
            previousNode = child;
View Full Code Here

           
            if (processingRootNodes == null || processingRootNodes.size() == 0) {
                // If the result is null, there will be no processing to do
                document = null;
            } else {
                final Node firstProcessingRootNode = processingRootNodes.get(0);
                if (processingRootNodes.size() == 1 &&
                        firstProcessingRootNode != null &&
                        firstProcessingRootNode instanceof Document) {
                    // If it is a document, just process it as it is output from the filter
                    document = (Document) firstProcessingRootNode;
                } else {
                    // Fragment exists and it is not a Document. We will therefore lose DOCTYPE
                    final String documentName = document.getDocumentName();
                    document = new Document(documentName);
                    for (final Node processingRootNode : processingRootNodes) {
                        if (processingRootNode != null) {
                            final Node clonedProcessingRootNode =
                                    processingRootNode.cloneNode(document, false);
                            document.addChild(clonedProcessingRootNode);
                        }
                    }
                    document.precompute(this.configuration);
View Full Code Here

            }
        }

        // Check whether this is a node specifying a fragment signature. If it is, process its parameters.
        if (nodes.size() == 1 && this.fragmentSignatureAttributeName != null) {
            final Node node = nodes.get(0);
            if (node instanceof NestableAttributeHolderNode) {
                final NestableAttributeHolderNode attributeHolderNode = (NestableAttributeHolderNode)node;
                if (attributeHolderNode.hasNormalizedAttribute(this.dialectPrefix, this.fragmentSignatureAttributeName)) {
                    final String attributeValue =
                            attributeHolderNode.getAttributeValueFromNormalizedName(
View Full Code Here

            super.endCDATA();

            this.cdataMode = false;
            if(this.cdataBufferLen > 0) {
                final Node cdata =
                        new CDATASection(new String(this.cdataBuffer, 0, this.cdataBufferLen), null, null, true);
                if (this.elementStack.isEmpty()) {
                    this.rootNodes.add(cdata);
                } else {
                    final NestableNode parent = this.elementStack.peek();
View Full Code Here

         */
        private void flushBuffer() {
           
            if (this.textBufferLen > 0) {

                final Node textNode =
                        new Text(new String(this.textBuffer, 0, this.textBufferLen), null, null, true);
               
                if (this.elementStack.isEmpty()) {
                    this.rootNodes.add(textNode);
                } else {
View Full Code Here

    Document contentdocument   = (Document)content.getParent();

    // Copy text outside of the root element, keeping whitespace copied to a minimum
    boolean beforehtml = true;
    boolean allownext = false;
    Node lastnode = content;
    for (Node externalnode: decoratordocument.getChildren()) {
      if (externalnode.equals(decorator)) {
        beforehtml = false;
        allownext = true;
        continue;
View Full Code Here

    int indexoflastoftype  = -1;
    int indexoflastelement = -1;
    int indexoflastgap     = -1;
    List<Node> headnodes = head.getChildren();
    for (int i = 0; i < headnodes.size(); i++) {
      Node headnode = headnodes.get(i);
      if (headnode instanceof Element) {
        indexoflastelement = i;
        if (HeadElement.findMatchingType((Element)headnode) == type) {
          indexoflastoftype = i;
        }
View Full Code Here

TOP

Related Classes of org.thymeleaf.dom.Node

Copyright © 2018 www.massapicom. 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.