Package com.google.gwt.uibinder.rebind

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


    // If the UiChild tag has no children just return.
    if (!children.hasNext()) {
      return;
    }
    XMLElement toAdd = children.next();

    if (!writer.isImportedElement(toAdd)) {
      writer.die(child, "Expected child from a urn:import namespace, found %s",
          toAdd);
    }
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

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

        if (!writer.isWidgetElement(headerElement)) {
          writer.die(headerElement, "Is not a widget");
        }
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.getPrefix(), child);
      }

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

    if (!writer.useLazyWidgetBuilders()) {
      writer.die("LazyPanel only works with UiBinder.useLazyWidgetBuilders enabled.");
    }

    XMLElement child = elem.consumeSingleChildElement();
    if (!writer.isWidgetElement(child)) {
      writer.die(child, "Expecting only widgets in %s", elem);
    }

    String childFieldName = writer.parseElementToField(child);
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, writer.declareTemplateCall(html), size);
      } else if (children.customHeader != null) {
        XMLElement headerElement = children.customHeader.consumeSingleChildElement();
        String size = children.customHeader.consumeRequiredDoubleAttribute("size");
        if (!writer.isWidgetElement(headerElement)) {
          writer.die(headerElement, "Is not a widget");
        }
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.parseElementToFieldWriter(childElem);

      genSetWidgetTextCall(idHolder, childFieldWriter.getName());

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

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

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

      if (!writer.isWidgetElement(headerElement)) {
        writer.die(headerElement, "Must be a widget");
      }
View Full Code Here

TOP

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

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.