Package com.google.template.soy.soytree.SoyNode

Examples of com.google.template.soy.soytree.SoyNode.BlockNode.addChild()


    ExprRootNode<?> componentNameExpr = node.getComponentNameExpr();
    if (componentNameExpr != null) {
      PrintNode pn =
          new PrintNode(nodeIdGen.genId(), false, new ExprUnion(componentNameExpr), null);
      pn.addChild(new PrintDirectiveNode(nodeIdGen.genId(), "|id", ""));
      parent.addChild(indexInParent, pn);
      indexInParent += 1;
    }

    // Add a RawTextNode for the selectorText. Also includes preceding dash ("-") if there is a
    // preceding componentName.
View Full Code Here


      }
    }
    if (componentNameExpr != null) {
      selectorText = "-" + selectorText;
    }
    parent.addChild(indexInParent, new RawTextNode(nodeIdGen.genId(), selectorText));
  }


  // -----------------------------------------------------------------------------------------------
  // Implementations for interfaces.
View Full Code Here

      } else {
        // First add the preceding consecutive RawTextNodes, if any.
        addConsecutiveRawTextNodesAsOneNodeHelper(nodeAsBlock, consecutiveRawTextNodes);
        consecutiveRawTextNodes.clear();
        // Then add the current new child.
        nodeAsBlock.addChild(origChild);
      }
    }

    // Add the final group of consecutive RawTextNodes, if any.
    addConsecutiveRawTextNodesAsOneNodeHelper(nodeAsBlock, consecutiveRawTextNodes);
View Full Code Here

      } else {
        // First add the preceding consecutive RawTextNodes, if any.
        addConsecutiveRawTextNodesAsOneNodeHelper(nodeAsBlock, consecutiveRawTextNodes);
        consecutiveRawTextNodes.clear();
        // Then add the current new child.
        nodeAsBlock.addChild(origChild);
      }
    }

    // Add the final group of consecutive RawTextNodes, if any.
    addConsecutiveRawTextNodesAsOneNodeHelper(nodeAsBlock, consecutiveRawTextNodes);
View Full Code Here

      indexUnderNewParent++;
    }

    // Move the node.
    googMsgNode.getParent().removeChild(googMsgNode);
    newParent.addChild(indexUnderNewParent, googMsgNode);
  }

}
View Full Code Here

        new GoogMsgRefNode(nodeIdGen.genId(), googMsgNode.getRenderedGoogMsgVarName());

    BlockNode parent = msgNode.getParent();
    int msgNodeIndex = parent.getChildIndex(msgNode);
    parent.replaceChild(msgNodeIndex, googMsgNode);
    parent.addChild(msgNodeIndex + 1, googMsgRefNode);
  }

}
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.