java.lang.Object | |||
↳ | com.google.gwt.user.client.ui.UIObject | ||
↳ | com.google.gwt.user.client.ui.Widget | ||
↳ | com.google.gwt.user.client.ui.Panel |
Known Direct Subclasses |
Known Indirect Subclasses |
Abstract base class for all panels, which are widgets that can contain other widgets.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a child widget.
| |||||||||||
Removes all child widgets.
| |||||||||||
Removes a child widget.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Finalize the attachment of a Widget to this Panel.
| |||||||||||
This method is deprecated.
Use
adopt(Widget) .
| |||||||||||
This method is deprecated.
Use
orphan(Widget) .
| |||||||||||
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call
onAttach() for each of its
child widgets. | |||||||||||
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call
onDetach() for each of its
child widgets. | |||||||||||
This method must be called as part of the remove method of any Panel. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.Widget
| |||||||||||
From class
com.google.gwt.user.client.ui.UIObject
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface com.google.gwt.event.logical.shared.HasAttachHandlers | |||||||||||
From interface com.google.gwt.event.shared.HasHandlers | |||||||||||
From interface
com.google.gwt.user.client.EventListener
| |||||||||||
From interface
com.google.gwt.user.client.ui.HasWidgets
| |||||||||||
From interface
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
| |||||||||||
From interface
com.google.gwt.user.client.ui.IsWidget
| |||||||||||
From interface
java.lang.Iterable
|
Adds a child widget.
How to Override this Method
There are several important things that must take place in the correct order to properly add or insert a Widget to a Panel. Not all of these steps will be relevant to every Panel, but all of the steps must be considered.
adjustIndex(Widget, int)
.removeFromParent()
on the
Widget.WidgetCollection
at the appropriate index.adopt(Widget)
to finalize the add as the
very last step.child | the widget to be added |
---|
UnsupportedOperationException | if this method is not supported (most often this means that a specific overload must be called) |
---|
Removes all child widgets.
Removes a child widget.
How to Override this Method
There are several important things that must take place in the correct order to properly remove a Widget from a Panel. Not all of these steps will be relevant to every Panel, but all of the steps must be considered.
false
if it is not.orphan(Widget)
first while the child
Widget is still attached.WidgetCollection
.child | the widget to be removed |
---|
true
if the child was present
Finalize the attachment of a Widget to this Panel. This method is the
last step in adding or inserting a Widget into a Panel, and should
be called after physical attachment in the DOM is complete. This Panel
becomes the parent of the child Widget, and the child will now fire its
onAttach()
event if this Panel is currently attached.
child | the widget to be adopted |
---|
This method is deprecated.
Use adopt(Widget)
.
This method was formerly part of the process of adding a Widget to a Panel
but has been deprecated in favor of adopt(Widget)
.
This method is deprecated.
Use orphan(Widget)
.
This method was formerly part of the process of removing a Widget from a
Panel but has been deprecated in favor of orphan(Widget)
.
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call onAttach()
for each of its
child widgets.
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call onDetach()
for each of its
child widgets.
This method must be called as part of the remove method of any Panel. It
ensures that the Widget's parent is cleared. This method should be called
after verifying that the child Widget is an existing child of the Panel,
but before physically removing the child Widget from the DOM. The child
will now fire its onDetach()
event if this Panel is
currently attached.
Calls to orphan(Widget)
should be wrapped in a try/finally block
to ensure that the widget is physically detached even if orphan throws an
exception.
child | the widget to be disowned |
---|