Package com.google.gwt.uibinder.rebind

Examples of com.google.gwt.uibinder.rebind.XMLElement$PostProcessingInterpreter


      if (translated == null) {
        writer.die(elem, "Invalid value: dockDirection='" + value + "'");
      }

      // And they can only have a single child widget.
      XMLElement widget = child.consumeSingleChildElement();
      String childFieldName = writer.parseElementToField(widget);
      writer.addStatement("%1$s.add(%2$s, %3$s);", fieldName, childFieldName, translated);

      // And they can optionally have a width.
      if (child.hasAttribute("width")) {
View Full Code Here


            writer, fieldName);
        String html = children.header.consumeInnerHtml(htmlInt);
        writer.addStatement("%s.add(%s, \"%s\", true);", fieldName,
            childFieldName, html);
      } else if (children.customHeader != null) {
        XMLElement headerElement =
          children.customHeader.consumeSingleChildElement();

        if (!writer.isWidgetElement(headerElement)) {
          writer.die("In %s of %s, %s is not a widget", children.customHeader,
              tabElem, headerElement);
View Full Code Here

                + "<%2$s:north>, <%2$s:south>, <%2$s:east>, <%2$s:west> or <%2$s:center>, "
                + "but found %3$s", elem, elem.getPrefix(), child);
      }

      // Consume the single widget element.
      XMLElement widget = child.consumeSingleChildElement();
      if (!writer.isWidgetElement(widget)) {
        writer.die("In %s, %s must contain a widget, but found %s", elem, child,
            widget);
      }
      String widgetName = writer.parseElementToField(widget);
View Full Code Here

      // Get the stack element.
      if (!isElementType(elem, child, STACK_ELEM)) {
        writer.die("In %s, Only <stack> children are allowed.", elem);
      }

      XMLElement headerElem = null, widgetElem = null;
      for (XMLElement stackChild : child.consumeChildElements()) {
        // Get the header.
        if (isElementType(elem, stackChild, HEADER_ELEM)) {
          if (headerElem != null) {
            writer.die("In %s, Only one <header> allowed per <stack>", elem);
          }
          headerElem = stackChild;
          continue;
        }

        // Get the widget.
        if (widgetElem != null) {
          writer.die("In %s, Only one child widget allowed per <stack>", elem);
        }
        widgetElem = stackChild;
      }

      String size = headerElem.consumeDoubleAttribute("size");
      XMLElement headerWidgetElem = headerElem.consumeSingleChildElement();
      String headerFieldName = writer.parseElementToField(headerWidgetElem);
      String childFieldName = writer.parseElementToField(widgetElem);

      writer.addStatement("%s.add(%s, %s, %s);", fieldName, childFieldName,
          headerFieldName, size);
View Full Code Here

      String bodyField = writer.parseElementToField(children.body);
      writer.addInitStatement("%s.add(%s);", panelField, bodyField);
    }

    if (null != children.customHeader) {
      XMLElement headerElement = children.customHeader.consumeSingleChildElement();

      if (!writer.isWidgetElement(headerElement)) {
        writer.die("In %s of %s, %s is not a widget", children.customHeader,
            panelElem, headerElement);
      }
View Full Code Here

      String tagName = child.getLocalName();

      if (ns != null && ns.equals(elem.getNamespaceUri())
          && localTagNameIsCell(tagName)) {
        // It's a cell element, so parse its single child as a widget.
        XMLElement widget = child.consumeSingleChildElement();
        FieldWriter childField = writer.parseElementToField(widget);
        writer.addStatement("%1$s.add(%2$s);", fieldName, childField.getNextReference());

        // Parse the cell tag's alignment & size attributes.
        parseCellAttributes(child, fieldName, childField, writer);
View Full Code Here

  @Override
  public String postProcess(String consumed) throws UnableToCompleteException {
    FieldWriter fieldWriter = fieldManager.require(fieldName);

    for (String idHolder : idToWidgetElement.keySet()) {
      XMLElement childElem = idToWidgetElement.get(idHolder);
      FieldWriter childFieldWriter = uiWriter.parseElementToField(childElem);

      genSetWidgetTextCall(idHolder, childFieldWriter.getName());

      if (uiWriter.useLazyWidgetBuilders()) {
View Full Code Here

    map.put("dl", "dt");
    LEGAL_CHILD_ELEMENTS = Collections.unmodifiableMap(map);
  }

  private static String getLegalPlaceholderTag(XMLElement elem) {
    XMLElement parent = elem.getParent();
    String tag = null;
    if (parent != null) {
      tag = LEGAL_CHILD_ELEMENTS.get(parent.getLocalName());
    }
    if (tag == null) {
      tag = DEFAULT_CHILD_ELEMENT;
    }
    return tag;
View Full Code Here

    Element w3cElem = (Element) doc.getDocumentElement().getElementsByTagName(
        tag).item(0);
    Assert.assertNotNull(
        String.format("Expected to find <%s> element in test DOM", tag),
        w3cElem);
    XMLElement elem = elemProvider.get(w3cElem);
    return elem;
  }
View Full Code Here

    for (XMLElement child : elem.consumeChildElements()) {
      String ns = child.getNamespaceUri();
      String tagName = child.getLocalName();
      if (ns.equals(elem.getNamespaceUri()) && tagName.equals(CELL_TAG)) {
        // It's a cell element, so parse its single child as a widget.
        XMLElement widget = child.consumeSingleChildElement();
        if (widget == null) {
          writer.die("Cell must contain a single child widget");
        }
        String childFieldName = writer.parseElementToField(widget);
        writer.addStatement("%1$s.add(%2$s);", fieldName, childFieldName);
View Full Code Here

TOP

Related Classes of com.google.gwt.uibinder.rebind.XMLElement$PostProcessingInterpreter

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.