Example usage for com.google.gwt.query.client.plugins.widgets WidgetsUtils matchesTags

List of usage examples for com.google.gwt.query.client.plugins.widgets WidgetsUtils matchesTags

Introduction

In this page you can find the example usage for com.google.gwt.query.client.plugins.widgets WidgetsUtils matchesTags.

Prototype

public static boolean matchesTags(Element e, String... tagNames) 

Source Link

Document

Test if the tag name of the element is one of tag names given in parameter

Usage

From source file:gwtquery.plugins.enhance.client.gwt.ListBoxWidgetFactory.java

License:Apache License

public ListBox create(Element e) {

    ListBox listBox = new ListBox(options.isMultipleSelect());
    if (WidgetsUtils.matchesTags(e, "select")) {
        copyAttributes((SelectElement) e.cast(), (SelectElement) listBox.getElement().cast());
    }//w w w  . ja  v a 2 s .  c om

    GQuery itemsList = getItemsList(e);
    for (Element item : itemsList.elements()) {
        listBox.addItem(item.getInnerText());
    }

    WidgetsUtils.replaceOrAppend(e, listBox);
    return listBox;
}