Example usage for com.google.gwt.query.client.plugins.widgets WidgetsHtmlPanel WidgetsHtmlPanel

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

Introduction

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

Prototype

public WidgetsHtmlPanel(Element e) 

Source Link

Usage

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

License:Apache License

public DecoratorPanel create(Element e) {

    DecoratorPanel decoratorPanel = new DecoratorPanel();

    WidgetsUtils.replaceOrAppend(e, decoratorPanel);

    decoratorPanel.add(new WidgetsHtmlPanel(e));

    return decoratorPanel;
}

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

License:Apache License

public DisclosurePanel create(Element e) {

    String headerValue = "";
    /*if (options.getHeaderTitle() != null){
      headerValue = options.getHeaderTitle();
    }else{*///from  w  w w  . ja  v a  2s .  c o m
    headerValue = $(options.getHeaderSelector(), e).first().remove().text();
    //}

    DisclosurePanel disclosurePanel = new DisclosurePanel();
    disclosurePanel.setHeader(new Label(headerValue));

    WidgetsUtils.replaceOrAppend(e, disclosurePanel);

    disclosurePanel.add(new WidgetsHtmlPanel(e));

    return disclosurePanel;
}

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

License:Apache License

public StackPanel create(Element e) {
    StackPanel stackPanel = options.isDecorated() ? new DecoratedStackPanel() : new StackPanel();

    WidgetsUtils.replaceOrAppend(e, stackPanel);

    GQuery contents = $(options.getContentSelector(), e);
    GQuery headers = $(options.getHeaderSelector(), e);

    for (int i = 0; i < contents.length(); i++) {
        Element content = contents.get(i);
        Element header = headers.get(i);

        Widget contentWidget = $(content).widget();
        if (contentWidget == null) {
            contentWidget = new WidgetsHtmlPanel(content);
        }/*from w  ww.  jav  a 2s .c om*/

        stackPanel.add(contentWidget, header != null ? header.getInnerText() : "Undefined");

    }

    return stackPanel;
}

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   ww w  . ja v a  2s .  c o  m
        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;
}