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 | ||||
↳ | com.google.gwt.user.client.ui.AbsolutePanel |
Known Direct Subclasses |
An absolute panel positions all of its children absolutely, allowing them to overlap.
Note that this panel will not automatically resize itself to allow enough room for its absolutely-positioned children. It must be explicitly sized in order to make room for them.
Once a widget has been added to an absolute panel, the panel effectively "owns" the positioning of the widget. Any existing positioning attributes on the widget may be modified by the panel.
AbsolutePanel elements in UiBinder
templates lay out their children with absolute position, using
<g:at> elements. Each at element should have left
and
top
attributes in pixels. They also can contain widget children
directly, with no position specified.
For example:
<g:AbsolutePanel> <g:at left='10' top='20'> <g:Label>Lorem ipsum...</g:Label> </g:at> <g:Label>...dolores est.</g:Label> </g:AbsolutePanel>
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty absolute panel.
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an AbsolutePanel with the given element.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a widget to the panel at the specified position.
| |||||||||||
Adds a child widget.
| |||||||||||
Gets the position of the left outer border edge of the widget relative to
the left outer border edge of the panel.
| |||||||||||
Gets the position of the top outer border edge of the widget relative to
the top outer border edge of the panel.
| |||||||||||
Convenience overload to allow
IsWidget to be used directly. | |||||||||||
Inserts a child widget at the specified position before the specified
index.
| |||||||||||
Inserts a child widget before the specified index.
| |||||||||||
Overrides
remove(Widget) to change the removed
Widget's element back to static positioning.This is done so that any
positioning changes to the widget that were done by the panel are undone
when the widget is disowned from the panel. | |||||||||||
Sets the position of the specified child widget.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.ComplexPanel
| |||||||||||
From class
com.google.gwt.user.client.ui.Panel
| |||||||||||
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.IndexedPanel
| |||||||||||
From interface
com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
| |||||||||||
From interface
com.google.gwt.user.client.ui.InsertPanel
| |||||||||||
From interface
com.google.gwt.user.client.ui.InsertPanel.ForIsWidget
| |||||||||||
From interface
com.google.gwt.user.client.ui.IsWidget
| |||||||||||
From interface
java.lang.Iterable
|
Creates an empty absolute panel.
Creates an AbsolutePanel with the given element. This is protected so that
it can be used by RootPanel
or a subclass that wants to substitute
another element. The element is presumed to be a <div>.
elem | the element to be used for this panel |
---|
Adds a widget to the panel at the specified position. Setting a position of
(-1, -1)
will cause the child widget to be positioned
statically.
w | the widget to be added |
---|---|
left | the widget's left position |
top | the widget's top position |
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.w | the widget to be added |
---|
Gets the position of the left outer border edge of the widget relative to the left outer border edge of the panel.
w | the widget whose position is to be retrieved |
---|
Gets the position of the top outer border edge of the widget relative to the top outer border edge of the panel.
w | the widget whose position is to be retrieved |
---|
Convenience overload to allow IsWidget
to be used directly.
Inserts a child widget at the specified position before the specified
index. Setting a position of (-1, -1)
will cause the child
widget to be positioned statically. If the widget is already a child of
this panel, it will be moved to the specified index.
w | the child widget to be inserted |
---|---|
left | the widget's left position |
top | the widget's top position |
beforeIndex | the index before which it will be inserted |
IndexOutOfBoundsException | if beforeIndex is out of
range
|
---|
Inserts a child widget before the specified index. If the widget is already a child of this panel, it will be moved to the specified index.
w | the child widget to be inserted |
---|---|
beforeIndex | the index before which it will be inserted |
Overrides remove(Widget)
to change the removed
Widget's element back to static positioning.This is done so that any
positioning changes to the widget that were done by the panel are undone
when the widget is disowned from the panel.
w | the widget to be removed |
---|
true
if the child was present
Sets the position of the specified child widget. Setting a position of
(-1, -1)
will cause the child widget to be positioned
statically.
w | the child widget to be positioned |
---|---|
left | the widget's left position |
top | the widget's top position |