Example usage for com.google.gwt.uibinder.rebind XMLElement consumeStringAttribute

List of usage examples for com.google.gwt.uibinder.rebind XMLElement consumeStringAttribute

Introduction

In this page you can find the example usage for com.google.gwt.uibinder.rebind XMLElement consumeStringAttribute.

Prototype

public String consumeStringAttribute(String name) throws UnableToCompleteException 

Source Link

Document

Convenience method for parsing the named attribute as a String value or reference.

Usage

From source file:com.jhickman.web.gwt.gxtuibinder.elementparsers.menu.MenuBarItemParser.java

License:Apache License

public void parse(XMLElement elem, String fieldName, JClassType type, UiBinderWriter writer)
        throws UnableToCompleteException {
    XMLElement menu = elem.consumeSingleChildElement();

    if (!isMenuElement(writer, menu)) {
        writer.die(elem, "%s must contain a Menu, but found %s", elem, menu);
    }//  w w w .jav  a  2s  .  co m

    String menuItemText = elem.consumeStringAttribute("text");
    String menuFieldName = writer.parseElementToField(menu);

    writer.setFieldInitializerAsConstructor(fieldName, type, menuItemText, menuFieldName);
}