|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.client.ui.Panel com.google.gwt.user.client.ui.SimplePanel
public class SimplePanel
Base class for panels that contain only one widget.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
---|
HasWidgets.ForIsWidget |
Field Summary | |
---|---|
(package private) Widget |
widget
|
Fields inherited from class com.google.gwt.user.client.ui.Widget |
---|
eventsToSink |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR |
Constructor Summary | |
---|---|
|
SimplePanel()
Creates an empty panel that uses a DIV for its contents. |
protected |
SimplePanel(Element elem)
Creates an empty panel that uses the specified browser element for its contents. |
|
SimplePanel(Widget child)
Create a panel with the specified child widget. |
Method Summary | |
---|---|
void |
add(Widget w)
Adds a widget to this panel. |
protected Element |
getContainerElement()
Override this method to specify that an element other than the root element be the container for the panel's child widget. |
Widget |
getWidget()
Gets the panel's child widget. |
java.util.Iterator<Widget> |
iterator()
Gets an iterator for the contained widgets. |
boolean |
remove(Widget w)
Removes a child widget. |
void |
setWidget(IsWidget w)
Set the only widget of the receiver, replacing the previous widget if there was one. |
void |
setWidget(Widget w)
Sets this panel's widget. |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
Widget widget
Constructor Detail |
---|
public SimplePanel()
public SimplePanel(Widget child)
child
- the child to add to the panelprotected SimplePanel(Element elem)
elem
- the browser element to useMethod Detail |
---|
public void add(Widget w)
add
in interface HasWidgets
add
in class Panel
w
- the child widget to be addedHasWidgets.add(Widget)
public Widget getWidget()
getWidget
in interface HasOneWidget
null
if none is presentpublic java.util.Iterator<Widget> iterator()
HasWidgets
Iterator.remove()
.
iterator
in interface HasWidgets
iterator
in interface java.lang.Iterable<Widget>
public boolean remove(Widget w)
Panel
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.Panel.orphan(Widget)
first while the child
Widget is still attached.WidgetCollection
.
remove
in interface HasWidgets
remove
in class Panel
w
- the widget to be removed
true
if the child was presentpublic void setWidget(IsWidget w)
AcceptsOneWidget
setWidget
in interface AcceptsOneWidget
w
- the widget, or null
to remove the widgetSimplePanel
public void setWidget(Widget w)
setWidget
in interface HasOneWidget
w
- the panel's new widget, or null
to clear the panelprotected Element getContainerElement()
Element
class defined in the
User
module to maintain backwards compatibility.
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |