Class Panel
Abstract base class for all panels, which are widgets that can contain other
widgets.
Methods
add(Widget) | Adds a child widget. |
adopt(Widget, Element) | This method must be called as part of the add method of any panel. |
clear() | Removes all child widgets. |
disown(Widget) | This method must be called whenever a Widget is removed. |
onAttach() | This method is called when a widget is attached to the browser's document. |
onDetach() | This method is called when a widget is detached from the browser's
document. |
Method Detail
add
Adds a child widget.
Parameters
- w
- the widget to be added
adopt
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
clear
public void clear()
Removes all child widgets.
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()
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
onLoad method.
onDetach
protected void onDetach()
This method is called when a widget is detached from the browser's
document. It must not be overridden, except by
Panel.