Package com.google.gwt.uibinder.rebind

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


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

      // And they can only have a single child widget.
      XMLElement widget = child.consumeSingleChildElement();
      if (widget == null) {
        writer.die("Dock must contain a single child widget.");
      }
      String childFieldName = writer.parseElementToField(widget);
      writer.addStatement("%1$s.add(%2$s, %3$s);", fieldName, childFieldName, translated);
View Full Code Here


            "In %s, child must be one of {north, south, east, west, center}",
            elem);
      }

      // Consume the single widget element.
      XMLElement widget = child.consumeSingleChildElement();
      String childFieldName = writer.parseElementToField(widget);

      if (requiresSize(child)) {
        double size = child.consumeDoubleAttribute("size");
        writer.addStatement("%s.%s(%s, %f);", fieldName, addMethodName(child),
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;
      }

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

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

   * have been handed to {@link #interpretElement}.
   */
  @Override
  public String postProcess(String consumed) throws UnableToCompleteException {
    for (String idHolder : idToWidgetElement.keySet()) {
      XMLElement childElem = idToWidgetElement.get(idHolder);
      String childField = uiWriter.parseElementToField(childElem);

      genSetWidgetTextCall(idHolder, childField);
      uiWriter.addInitStatement("%1$s.addAndReplaceElement(%2$s, %3$s);",
          fieldName, childField, idHolder);
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

      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 size = children.header.consumeRequiredDoubleAttribute("size");
        String html = children.header.consumeInnerHtml(htmlInt);
        writer.addStatement("%s.add(%s, \"%s\", true, %s);", fieldName,
            childFieldName, html, size);
      } else if (children.customHeader != null) {
        XMLElement headerElement =
          children.customHeader.consumeSingleChildElement();
        String size = children.customHeader.consumeRequiredDoubleAttribute("size");
        if (!writer.isWidgetElement(headerElement)) {
          writer.die("In %s of %s, %s is not a widget", children.customHeader,
              stackElem, headerElement);
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();
        String childFieldName = writer.parseElementToField(widget);
        writer.addStatement("%1$s.add(%2$s);", fieldName, childFieldName);

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

      if (translated == null) {
        writer.die("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

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.