Example usage for com.google.gwt.user.client.ui HasWidgets HasWidgets

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

Introduction

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

Prototype

HasWidgets

Source Link

Usage

From source file:org.geomajas.gwt2.client.widget.map.MapWidgetImpl.java

License:Open Source License

@Override
public HasWidgets getWidgetContainer() {
    return new HasWidgets() {

        @Override//from   w w  w.jav a  2 s.  com
        public void add(Widget w) {
            w.getElement().getStyle().setPosition(Style.Position.ABSOLUTE);
            MapWidgetImpl.this.add(w);
            if (!(w instanceof Watermark)) {
                widgets.add(w);
            }
        }

        @Override
        public void clear() {
            while (widgets.size() > 0) {
                remove(widgets.get(0));
            }
        }

        @Override
        public Iterator<Widget> iterator() {
            return widgets.iterator();
        }

        @Override
        public boolean remove(Widget w) {
            widgets.remove(w);
            return MapWidgetImpl.this.remove(w);
        }
    };
}