Class SimplePanel

public class SimplePanel
extends Panel

// Superclass of ScrollPanel, PopupPanel, FocusPanel
Abstract base class for panels that contain only one widget.

Constructors

SimplePanel()Creates an empty panel that uses a DIV for its contents.
SimplePanel(Element)Creates an empty panel that uses the specified browser element for its contents.

Methods

add(Widget)Adds a new child widget to the panel.
clear()Removes all widgets from this panel.
getContainerElement()Override this method to specify that an element other than the root element be the container for the panel's child widget.
getWidget(int)
getWidgetCount()
getWidgetIndex(Widget)
iterator()Gets an iterator for the contained widgets.
remove(Widget)Removes a widget from the panel.
setWidget(Widget)

Constructor Detail

SimplePanel

protected SimplePanel()
Creates an empty panel that uses a DIV for its contents.

SimplePanel

protected SimplePanel(Element elem)
Creates an empty panel that uses the specified browser element for its contents.

Parameters

elem

Method Detail

add

public abstract boolean add(Widget w)
Adds a new child widget to the panel.

Parameters

w
the child widget to be added

Return Value

true on success (some panels place restrictions on how children may be added or inserted)

clear

public abstract void clear()
Removes all widgets from this panel.

getContainerElement

protected Element getContainerElement()
Override this method to specify that an element other than the root element be the container for the panel's child widget. This can be useful when you want to create a simple panel that decorates its contents.

Return Value

the element to be used as the panel's container

getWidget

public Widget getWidget(int index)

Parameters

index

getWidgetCount

public int getWidgetCount()

getWidgetIndex

public int getWidgetIndex(Widget child)

Parameters

child

iterator

public Iterator iterator()
Gets an iterator for the contained widgets.

remove

public abstract boolean remove(Widget w)
Removes a widget from the panel.

Parameters

w
the widget to be removed

Return Value

true if the widget was present

setWidget

protected void setWidget(Widget w)

Parameters

w