|
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.ComplexPanel
public abstract class ComplexPanel
Abstract base class for panels that can contain multiple child widgets.
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.IndexedPanel |
---|
IndexedPanel.ForIsWidget |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
---|
HasWidgets.ForIsWidget |
Field Summary |
---|
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 | |
---|---|
ComplexPanel()
|
Method Summary | |
---|---|
protected void |
add(Widget child,
Element container)
Adds a new child widget to the panel, attaching its Element to the specified container Element. |
protected void |
add(Widget child,
Element container)
Deprecated. Call and override add(Widget, Element) instead. |
protected int |
adjustIndex(Widget child,
int beforeIndex)
Adjusts beforeIndex to account for the possibility that the given widget is already a child of this panel. |
protected void |
checkIndexBoundsForAccess(int index)
Checks that index is in the range [0, getWidgetCount()), which
is the valid range on accessible indexes. |
protected void |
checkIndexBoundsForInsertion(int index)
Checks that index is in the range [0, getWidgetCount()], which
is the valid range for indexes on an insertion. |
(package private) void |
doLogicalClear()
|
protected WidgetCollection |
getChildren()
Gets the list of children contained in this panel. |
Widget |
getWidget(int index)
Gets the child widget at the specified index. |
int |
getWidgetCount()
Gets the number of child widgets in this panel. |
int |
getWidgetIndex(IsWidget child)
|
int |
getWidgetIndex(Widget child)
Gets the index of the specified child widget. |
protected void |
insert(Widget child,
Element container,
int beforeIndex,
boolean domInsert)
Insert a new child Widget into this Panel at a specified index, attaching its Element to the specified container Element. |
protected void |
insert(Widget child,
Element container,
int beforeIndex,
boolean domInsert)
Deprecated. Call and override insert(Widget, Element, int, boolean) instead. |
java.util.Iterator<Widget> |
iterator()
Gets an iterator for the contained widgets. |
boolean |
remove(int index)
Removes the widget at the specified index. |
boolean |
remove(Widget w)
Removes a child widget. |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
add, 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 |
Constructor Detail |
---|
public ComplexPanel()
Method Detail |
---|
public Widget getWidget(int index)
IndexedPanel
getWidget
in interface IndexedPanel
index
- the child widget's index
public int getWidgetCount()
IndexedPanel
getWidgetCount
in interface IndexedPanel
public int getWidgetIndex(Widget child)
IndexedPanel
getWidgetIndex
in interface IndexedPanel
child
- the widget to be found
-1
if it is not a child of this
panelpublic int getWidgetIndex(IsWidget child)
getWidgetIndex
in interface IndexedPanel.ForIsWidget
public java.util.Iterator<Widget> iterator()
HasWidgets
Iterator.remove()
.
iterator
in interface HasWidgets
iterator
in interface java.lang.Iterable<Widget>
public boolean remove(int index)
IndexedPanel
remove
in interface IndexedPanel
index
- the index of the widget to be removed
false
if the widget is not presentpublic 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 presentprotected void add(Widget child, Element container)
child
- the child widget to be addedcontainer
- the element within which the child will be contained@Deprecated protected void add(Widget child, Element container)
add(Widget, Element)
instead.
protected int adjustIndex(Widget child, int beforeIndex)
child
- the widget that might be an existing childbeforeIndex
- the index at which it will be added to this panel
protected void checkIndexBoundsForAccess(int index)
index
is in the range [0, getWidgetCount()), which
is the valid range on accessible indexes.
index
- the index being accessedprotected void checkIndexBoundsForInsertion(int index)
index
is in the range [0, getWidgetCount()], which
is the valid range for indexes on an insertion.
index
- the index where insertion will occurprotected WidgetCollection getChildren()
protected void insert(Widget child, Element container, int beforeIndex, boolean domInsert)
domInsert
.
child
- the child Widget to be addedcontainer
- the Element within which child
will be
containedbeforeIndex
- the index before which child
will be
inserteddomInsert
- if true
, insert child
into
container
at beforeIndex
; otherwise
append child
to the end of container
.@Deprecated protected void insert(Widget child, Element container, int beforeIndex, boolean domInsert)
insert(Widget, Element, int, boolean)
instead.
void doLogicalClear()
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |