Example usage for com.google.gwt.query.client GQuery text

List of usage examples for com.google.gwt.query.client GQuery text

Introduction

In this page you can find the example usage for com.google.gwt.query.client GQuery text.

Prototype

public String text() 

Source Link

Document

Return the concatened text contained in the matched elements.

Usage

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

License:Apache License

public TabPanel create(Element e) {
    TabPanel tabPanel = new TabPanel();

    GQuery tabs = $(options.getTabSelector(), e);
    GQuery titles = $(options.getTitleSelector(), e);

    for (int i = 0; i < tabs.length(); i++) {
        GQuery tab = tabs.eq(i);//from w  w w .j a  v  a  2s.  com
        GQuery title = titles.eq(i);

        Widget tabWidget = tab.widget();
        if (tabWidget == null) {
            tabWidget = new WidgetsHtmlPanel(tab.get(0));
        }

        tabPanel.add(tabWidget, title.get(0) != null ? title.text() : "Tab " + (i + 1));

    }
    if (tabs.length() > 0) {
        tabPanel.selectTab(0);
    }

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