|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
public abstract class Panel
Abstract base class for all panels, which are widgets that can contain other widgets.
Constructor Summary | |
---|---|
Panel()
|
Method Summary | |
---|---|
void |
add(Widget child)
Adds a child widget. |
protected void |
adopt(Widget child)
Finalize the attachment of a Widget to this Panel. |
protected void |
adopt(Widget w,
Element container)
Deprecated. Use adopt(Widget) . |
void |
clear()
Removes all child widgets. |
protected void |
disown(Widget w)
Deprecated. Use orphan(Widget) . |
protected void |
doAttachChildren()
If a widget implements HasWidgets, it must override this method and call onAttach() for each of its child widgets. |
protected void |
doDetachChildren()
If a widget implements HasWidgets, it must override this method and call onDetach() for each of its child widgets. |
protected void |
onLoad()
A Panel's onLoad method will be called after all of its children are attached. |
protected void |
onUnload()
A Panel's onUnload method will be called before its children become detached themselves. |
protected void |
orphan(Widget child)
This method must be called as part of the remove method of any Panel. |
abstract boolean |
remove(Widget child)
Removes a child widget. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
getParent, isAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setElement |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, 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 |
Constructor Detail |
---|
public Panel()
Method Detail |
---|
public void add(Widget child)
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.
ComplexPanel.adjustIndex(Widget, int)
.Widget.removeFromParent()
on the
Widget.WidgetCollection
at the appropriate index.adopt(Widget)
to finalize the add as the
very last step.
add
in interface HasWidgets
child
- the widget to be added
java.lang.UnsupportedOperationException
- if this method is not supported (most
often this means that a specific overload must be called)HasWidgets.add(Widget)
public void clear()
HasWidgets
clear
in interface HasWidgets
public abstract boolean remove(Widget child)
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
.
remove
in interface HasWidgets
child
- the widget to be removed
true
if the child was presentprotected final void adopt(Widget child)
Widget.onAttach()
event if this Panel is currently attached.
child
- the widget to be adoptedadd(Widget)
protected void adopt(Widget w, Element container)
adopt(Widget)
.
adopt(Widget)
.
protected void disown(Widget w)
orphan(Widget)
.
orphan(Widget)
.
protected void doAttachChildren()
Widget
doAttachChildren
in class Widget
Widget.onAttach()
protected void doDetachChildren()
Widget
doDetachChildren
in class Widget
Widget.onDetach()
protected void onLoad()
onLoad
in class Widget
Widget.onLoad()
protected void onUnload()
onUnload
in class Widget
Widget.onLoad()
protected final void orphan(Widget child)
Widget.onDetach()
event if this Panel is
currently attached.
child
- the widget to be disownedadd(Widget)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |