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.LayoutPanel |
Known Direct Subclasses |
A panel that lays its children out in arbitrary
layers
using the
Layout
class.
This widget will only work in standards mode, which requires that the HTML page in which it is run have an explicit <!DOCTYPE> declaration.
LayoutPanel elements in UiBinder
templates lay out their children with arbitrary constraints, using
<g:layer> elements. Each layer may have any of the following constraint
attributes specified as CSS length attributes: left
,
top
, right
, bottom
, width
, and height
.
Precisely zero or two constraints are required for each axis (horizontal and vertical). Specifying no constraints implies that the child should fill that axis completely.
The valid sets of horizontal constraints are:
The valid sets of vertical constraints are:
The values of constraint attributes can be any valid CSS length,
such as 1px
, 3em
, or 0
(zero lengths require no
units).
For example:
<g:LayoutPanel> <!-- No constraints causes the layer to fill the parent --> <g:layer> <g:Label>Lorem ipsum...</g:Label> </g:layer> <!-- Position horizontally 25% from each edge; Vertically 4px from the top and 10em tall. --> <g:layer left='25%' right='25%' top='4px' height='10em'> <g:Label>Header</g:Label> </g:layer> </g:LayoutPanel>
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty layout panel.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a widget to this panel.
| |||||||||||
Layout children, animating over the specified period of time.
| |||||||||||
Layout children, animating over the specified period of time.
| |||||||||||
Layout children immediately.
| |||||||||||
Gets the container element wrapping the given child widget.
| |||||||||||
Inserts a widget before the specified index.
| |||||||||||
This method must be called whenever the implementor's size has been
modified.
| |||||||||||
Removes a child widget.
| |||||||||||
Sets the child widget's bottom and height values.
| |||||||||||
Sets the child widget's horizontal position within its layer.
| |||||||||||
Sets the child widget's left and right values.
| |||||||||||
Sets the child widget's left and width values.
| |||||||||||
Sets the child widget's right and width values.
| |||||||||||
Sets the child widget's top and bottom values.
| |||||||||||
Sets the child widget's top and height values.
| |||||||||||
Sets the child widget's vertical position within its layer.
| |||||||||||
Shows or hides the given widget and its layer.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is called immediately after a widget becomes attached to the
browser's document.
| |||||||||||
This method is called immediately before a widget will be detached from the
browser's document.
|
[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.AnimatedLayout
| |||||||||||
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.IsWidget
| |||||||||||
From interface
com.google.gwt.user.client.ui.RequiresResize
| |||||||||||
From interface
java.lang.Iterable
|
Creates an empty layout panel.
Adds a widget to this panel.
By default, each child will fill the panel. To build more interesting
layouts, set child widgets' layout constraints using
setWidgetLeftRight(Widget, double, Style.Unit, double, Style.Unit)
and related methods.
widget | the widget to be added |
---|
Layout children, animating over the specified period of time.
duration | the animation duration, in milliseconds |
---|
Layout children, animating over the specified period of time.
This method provides a callback that will be informed of animation updates. This can be used to create more complex animation effects.
duration | the animation duration, in milliseconds |
---|---|
callback | the animation callback |
Layout children immediately.
This is not normally necessary, unless you want to update child widgets'
positions explicitly to create a starting point for a subsequent call to
animate(int)
.
Gets the container element wrapping the given child widget.
Inserts a widget before the specified index.
By default, each child will fill the panel. To build more interesting
layouts, set child widgets' layout constraints using
setWidgetLeftRight(Widget, double, Style.Unit, double, Style.Unit)
and related methods.
Inserting a widget in this way has no effect on the DOM structure, but can be useful for other panels that wrap LayoutPanel to maintain insertion order.
widget | the widget to be inserted |
---|---|
beforeIndex | the index before which it will be inserted |
IndexOutOfBoundsException | if beforeIndex is out of
range
|
---|
This method must be called whenever the implementor's size has been modified.
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
.w | the widget to be removed |
---|
true
if the child was present
Sets the child widget's bottom and height values.
Sets the child widget's horizontal position within its layer.
Sets the child widget's left and right values.
Sets the child widget's left and width values.
Sets the child widget's right and width values.
Sets the child widget's top and bottom values.
Sets the child widget's top and height values.
Sets the child widget's vertical position within its layer.
Shows or hides the given widget and its layer. This method explicitly
calls setVisible(boolean)
on the child widget and ensures
that its associated layer is shown/hidden.
This method is called immediately after a widget becomes attached to the browser's document.
This method is called immediately before a widget will be detached from the browser's document.