Package com.google.gxp.compiler.base

Examples of com.google.gxp.compiler.base.Node


        "<gxp:template xmlns:gxp='http://google.com/2001/gxp'>"
        + "   "
        + "</gxp:template>");
    assertEquals(AlertSet.EMPTY, tree.getAlerts());
    assertEquals(1, tree.getChildren().get(0).getChildren().size());
    Node textNode = tree.getChildren().get(0).getChildren().get(0);
    assertTrue(textNode instanceof TextElement);
    assertEquals("   ", ((TextElement) textNode).getText());
  }
View Full Code Here


        + "</gxp:template>");

    assertEquals(AlertSet.EMPTY, tree.getAlerts());
    assertEquals(3, tree.getChildren().get(0).getChildren().size());

    Node ifElement = tree.getChildren().get(0).getChildren().get(0);
    assertTrue(ifElement instanceof GxpNamespace.GxpElement);
    assertTrue(((GxpNamespace.GxpElement)ifElement).getElementType()
               == GxpNamespace.ElementType.IF);

    Node textElement = tree.getChildren().get(0).getChildren().get(1);
    assertTrue(textElement instanceof TextElement);
    assertEquals(" \200 ",
                 ((TextElement) textElement).getText());

    Node exprElement = tree.getChildren().get(0).getChildren().get(2);
    assertTrue(exprElement instanceof GxpNamespace.GxpElement);
    assertTrue(((GxpNamespace.GxpElement)exprElement).getElementType()
               == GxpNamespace.ElementType.EVAL);
  }
View Full Code Here

    Alert alert2 = alerts.next();
    assertFalse(alerts.hasNext());
    assertEquals(
        "Resolved entity `//bar` to `/bar`", alert2.getMessage());

    Node textElement = tree.getChildren().get(0).getChildren().get(0);
    assertEquals("  [file /foo]  [file /bar]",
                 ((TextElement) textElement).getText());
  }
View Full Code Here

     */
    private ContentType createContentType(Node forNode, String defaultValue) {
      AttributeMap attrMap = nodeParts.getAttributes();
      Attribute attr = attrMap.getAttribute("content-type");

      Node node;
      String contentType;
      if (attr == null) {
        node = forNode;
        contentType = defaultValue;
      } else {
        node = attr;
        contentType = attr.getValue().getStaticString(alertSink, defaultValue);
      }

      Schema schema = (contentType == null)
          ? null
          : schemaFactory.fromContentTypeName(contentType);

      if (schema == null && contentType != null) {
        alertSink.add(new UnknownContentTypeError(node, contentType));
      }

      return (schema == null)
          ? null
          : new ContentType(node.getSourcePosition(),
                            node.getDisplayName(),
                            schema);
    }
View Full Code Here

     */
    private ContentType createContentType(Node forNode, String defaultValue) {
      AttributeMap attrMap = nodeParts.getAttributes();
      Attribute attr = attrMap.getAttribute("content-type");

      Node node;
      String contentType;
      if (attr == null) {
        node = forNode;
        contentType = defaultValue;
      } else {
        node = attr;
        contentType = attr.getValue().getStaticString(alertSink, defaultValue);
      }

      Schema schema = (contentType == null)
          ? null
          : schemaFactory.fromContentTypeName(contentType);

      if (schema == null && contentType != null) {
        alertSink.add(new UnknownContentTypeError(node, contentType));
      }

      return (schema == null)
          ? null
          : new ContentType(node.getSourcePosition(),
                            node.getDisplayName(),
                            schema);
    }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.base.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.