Class ComplexPanel

public class ComplexPanel
extends Panel

// Superclass of StackPanel, HTMLPanel, FlowPanel, DeckPanel, CellPanel, AbsolutePanel
Abstract base class for panels that can contain multiple child widgets.

Methods

add(Widget)Adds a new child widget to the panel.
clear()Removes all widgets from this panel.
getWidget(int)
getWidgetCount()
getWidgetIndex(Widget)
insert(Widget, int)Inserts a widget into the panel
iterator()Gets an iterator for the contained widgets.
remove(Widget)Removes a widget from the panel.

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.

getWidget

public Widget getWidget(int index)

Parameters

index

getWidgetCount

public int getWidgetCount()

getWidgetIndex

public int getWidgetIndex(Widget child)

Parameters

child

insert

public boolean insert(Widget w, int beforeIndex)
Inserts a widget into the panel

Parameters

w
the widget to be inserted
beforeIndex
the index before which it will be inserted

Return Value

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

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