Package com.google.gwt.uibinder.rebind

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


        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(headerElement, "Is not a widget");
        }
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

      if (isPositionElement(elem, child)) {
        // Parse position.
        String left = child.consumeRequiredIntAttribute("left");
        String top = child.consumeRequiredIntAttribute("top");
        // Add child widget.
        XMLElement widgetElem = child.consumeSingleChildElement();
        String widgetFieldName = writer.parseElementToField(widgetElem);
        writer.addStatement("%1$s.add(%2$s, %3$s, %4$s);", fieldName,
            widgetFieldName, left, top);
        continue;
      }
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(headerElement, "Must be a widget");
      }
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

  public void parse(XMLElement elem, String fieldName, JClassType type,
      UiBinderWriter writer) throws UnableToCompleteException {

    // Consume the single tableDefinition element.
    final XMLElement tableDefinition = elem.consumeSingleChildElement();

    if (!isTableDefinitionElement(tableDefinition)) {
      writer.die(
          "In %1$s, child must be an instance of TableDefinition but found %2$s",
          elem, tableDefinition);
    }

    final List<String> columnDefFieldNames = new ArrayList<String>();

    // Parse children.
    for (XMLElement columnDefinition : tableDefinition.consumeChildElements()) {
      if (!isColumnDefinitionElement(columnDefinition)) {
        writer.die("%s can contain only widgets, but found %s", elem,
            columnDefinition);
      }
View Full Code Here

  public void parse(XMLElement elem, String fieldName, JClassType type,
      UiBinderWriter writer) throws UnableToCompleteException {

    // Consume the single layout element.
    XMLElement layout = elem.consumeSingleChildElement();
    if (!isLayoutManagerElement(layout)) {
      writer.die(
          "In %1$s, child must be an instance of LayoutManager but found %2$s",
          elem, layout);
    }

    Map<String, String> layoutAttrs = new HashMap<String, String>();

    while (layout.getAttributeCount() > 0) {
      XMLAttribute attr = layout.getAttribute(0);
      layoutAttrs.put(attr.getLocalName(), attr.consumeStringValue());
    }

    // Parse children.
    for (XMLElement child : layout.consumeChildElements()) {
      if (!writer.isWidgetElement(child)) {
        writer.die("%s can contain only widgets, but found %s", elem, child);
      }
      if (child.getLocalName().endsWith("LayoutData")) {
        Map<String, String> layoutDataAttrs = new HashMap<String, String>();
        while (child.getAttributeCount() > 0) {
          XMLAttribute attr = child.getAttribute(0);
          layoutDataAttrs.put(attr.getLocalName(), attr.consumeStringValue());
        }
        XMLElement widget = child.consumeSingleChildElement();

        String childFieldName = writer.parseElementToField(child);
        String widgetFieldName = writer.parseElementToField(widget);

        boolean decorated = false;
View Full Code Here

      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);

      // Parse the CellPanel-specific attributes on the Dock element.
      CellPanelParser.parseCellAttributes(child, fieldName, childFieldName, writer);
View Full Code Here

  public void parse(XMLElement elem, String fieldName, JClassType type,
      UiBinderWriter writer) throws UnableToCompleteException {

    String caption = null;
    String body = null;
    XMLElement customCaption = null;

    String prefix = elem.getPrefix();

    for (XMLElement child : elem.consumeChildElements()) {
      if (CAPTION.equals(child.getLocalName())) {
View Full Code Here

TOP

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

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.