Class Panel
Abstract base class for all panels, which are widgets that can contain other
widgets.
Methods
add(Widget) | Adds a new child widget to the panel. |
adopt(Widget) | This method must be called as part of the add method of any panel. |
clear() | Removes all widgets from this panel. |
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. |
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)
adopt
protected void
adopt(
Widget w)
This method must be called as part of the add method of any panel. It
ensures that the Widget's parent is set properly.
Parameters
- w
-
clear
public abstract void clear()
Removes all widgets from this panel.
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
-
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.
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