com.google.gwt.user.client.ui
Class ComplexPanel

java.lang.Object
  extended bycom.google.gwt.user.client.ui.UIObject
      extended bycom.google.gwt.user.client.ui.Widget
          extended bycom.google.gwt.user.client.ui.Panel
              extended bycom.google.gwt.user.client.ui.ComplexPanel
All Implemented Interfaces:
EventListener, HasWidgets, IndexedPanel
Direct Known Subclasses:
AbsolutePanel, CellPanel, DeckPanel, FlowPanel, HTMLPanel, StackPanel

public abstract class ComplexPanel
extends Panel
implements IndexedPanel

Abstract base class for panels that can contain multiple child widgets.


Constructor Summary
ComplexPanel()
           
 
Method Summary
protected  int add(Widget w, Element container)
          Adds a new child widget to the panel.
protected  WidgetCollection getChildren()
          Gets the list of children contained in this panel.
 Widget getWidget(int index)
          Gets the child widget at the specified index.
 int getWidgetCount()
          Gets the number of child widgets in this panel.
 int getWidgetIndex(Widget child)
          Gets the index of the specified child widget.
protected  int insert(Widget w, Element container, int beforeIndex)
          Inserts a new child widget into the panel.
 java.util.Iterator iterator()
          Gets an iterator for the contained widgets.
 boolean remove(int index)
          Removes the widget at the specified index.
 boolean remove(Widget w)
          Removes a child widget.
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, disown, onAttach, onDetach
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setElement
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getTitle, isVisible, isVisible, removeStyleName, resetStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComplexPanel

public ComplexPanel()
Method Detail

getWidget

public Widget getWidget(int index)
Description copied from interface: IndexedPanel
Gets the child widget at the specified index.

Specified by:
getWidget in interface IndexedPanel
Parameters:
index - the child widget's index
Returns:
the child widget

getWidgetCount

public int getWidgetCount()
Description copied from interface: IndexedPanel
Gets the number of child widgets in this panel.

Specified by:
getWidgetCount in interface IndexedPanel
Returns:
the number of children

getWidgetIndex

public int getWidgetIndex(Widget child)
Description copied from interface: IndexedPanel
Gets the index of the specified child widget.

Specified by:
getWidgetIndex in interface IndexedPanel
Parameters:
child - the widget to be found
Returns:
the widget's index, or -1 if it is not a child of this panel

iterator

public java.util.Iterator iterator()
Description copied from interface: HasWidgets
Gets an iterator for the contained widgets. This iterator is required to implement Iterator.remove().

Specified by:
iterator in interface HasWidgets

remove

public boolean remove(int index)
Description copied from interface: IndexedPanel
Removes the widget at the specified index.

Specified by:
remove in interface IndexedPanel
Parameters:
index - the index of the widget to be removed
Returns:
false if the widget is not present

remove

public boolean remove(Widget w)
Description copied from interface: HasWidgets
Removes a child widget.

Specified by:
remove in interface HasWidgets
Parameters:
w - the widget to be removed
Returns:
true if the widget was present

add

protected int add(Widget w,
                  Element container)
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
Returns:
the index at which the widget was added

getChildren

protected WidgetCollection getChildren()
Gets the list of children contained in this panel.

Returns:
a collection of child widgets

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
Returns:
the index at which the widget was added