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

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
All Implemented Interfaces:
EventListener, HasWidgets
Direct Known Subclasses:
ComplexPanel, HTMLTable, SimplePanel

public abstract class Panel
extends Widget
implements HasWidgets

Abstract base class for all panels, which are widgets that can contain other widgets.


Constructor Summary
Panel()
           
 
Method Summary
 void add(Widget w)
          Adds a child widget.
protected  void adopt(Widget w, Element container)
          This method must be called as part of the add method of any panel.
 void clear()
          Removes all child widgets.
protected  void disown(Widget w)
          This method must be called whenever a Widget is removed.
protected  void onAttach()
          This method is called when a widget is attached to the browser's document.
protected  void onDetach()
          This method is called when a widget is detached from the browser's document.
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onBrowserEvent, onLoad, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, 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
 
Methods inherited from interface com.google.gwt.user.client.ui.HasWidgets
iterator, remove
 

Constructor Detail

Panel

public Panel()
Method Detail

add

public void add(Widget w)
Description copied from interface: HasWidgets
Adds a child widget.

Specified by:
add in interface HasWidgets
Parameters:
w - the widget to be added

clear

public void clear()
Description copied from interface: HasWidgets
Removes all child widgets.

Specified by:
clear in interface HasWidgets

adopt

protected void adopt(Widget w,
                     Element container)
This method must be called as part of the add method of any panel. It ensures that the Widget's parent is set properly, and that it is removed from any existing parent widget. It also attaches the child widget's DOM element to its new container, ensuring that this process occurs in the right order.

Parameters:
w - the widget to be adopted
container - the element within which it will be contained

disown

protected void disown(Widget w)
This method must be called whenever a Widget is removed. It ensures that the Widget's parent is cleared.

Parameters:
w - the widget to be disowned

onAttach

protected void onAttach()
Description copied from class: Widget
This method is called when a widget is attached to the browser's document. It must not be overridden, except by Panel. To receive notification when a widget is attached to the document, override the Widget.onLoad() method.

Overrides:
onAttach in class Widget

onDetach

protected void onDetach()
Description copied from class: Widget
This method is called when a widget is detached from the browser's document. It must not be overridden, except by Panel.

Overrides:
onDetach in class Widget