Example usage for com.google.gwt.user.client.ui HasOneWidget getWidget

List of usage examples for com.google.gwt.user.client.ui HasOneWidget getWidget

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HasOneWidget getWidget.

Prototype

Widget getWidget();

Source Link

Document

Gets the panel's child widget.

Usage

From source file:fr.putnami.pwt.core.widget.client.util.WidgetUtils.java

License:Open Source License

private static void collectChildren(Widget w, Set<Widget> children) {
    if (w instanceof HasWidgets) {
        HasWidgets hasWidgets = (HasWidgets) w;
        Iterator<Widget> it = hasWidgets.iterator();
        while (it.hasNext()) {
            Widget widget = it.next();/*from   w  ww .  j a  va 2 s  . c  o  m*/
            if (!children.contains(widget)) {
                children.add(widget);
                WidgetUtils.collectChildren(widget, children);
            }
        }
    } else if (w instanceof HasOneWidget) {
        HasOneWidget hasOneWidget = (HasOneWidget) w;
        Widget widget = hasOneWidget.getWidget();
        if (!children.contains(widget)) {
            children.add(widget);
            WidgetUtils.collectChildren(widget, children);
        }
    }
}