Class ComplexPanel
Abstract base class for panels that can contain multiple child widgets.
Methods
Method Detail
add
Adds a new child widget to the panel.
Parameters
- w
- the child widget to be added
- container
- the element within which the child will be contained
Return Value
the index at which the widget was added
getChildren
Gets the list of children contained in this panel.
Return Value
a collection of child widgets
getWidget
public
Widget getWidget(
int index)
Gets the child widget at the specified index.
Parameters
- index
- the child widget's index
Return Value
the child widget
getWidgetCount
public int getWidgetCount()
Gets the number of child widgets in this panel.
Return Value
the number of children
getWidgetIndex
public int
getWidgetIndex(
Widget child)
Gets the index of the specified child widget.
Parameters
- child
- the widget to be found
Return Value
the widget's index, or
-1
if it is not a child of
this panel
insert
protected int
insert(
Widget w, Element container, int beforeIndex)
Inserts a new child widget into the panel.
Parameters
- w
- the child widget to be added
- container
- the element within which the child will be contained
- beforeIndex
- the index before which the widget will be added
Return Value
the index at which the widget was added
iterator
Gets an iterator for the contained widgets. This iterator is required to
implement
Iterator.remove().
remove
public boolean remove(int index)
Removes the widget at the specified index.
Parameters
- index
- the index of the widget to be removed
Return Value
false
if the widget is not present
remove
public boolean
remove(
Widget w)
Removes a child widget.
Parameters
- w
- the widget to be removed
Return Value
true
if the widget was present