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.DockLayoutPanel |
Known Direct Subclasses |
A panel that lays its child widgets out "docked" at its outer edges, and allows its last widget to take up the remaining space in its center.
This widget will only work in standards mode, which requires that the HTML page in which it is run have an explicit <!DOCTYPE> declaration.
DockLayoutPanel elements in
UiBinder
templates
lay out their children in elements tagged with the cardinal directions,
and center:
Each child can hold only widget, and there can be only one <g:center>. However, there can be any number of the directional children.
(Note that the tags of the child elements are not
capitalized. This is meant to signal that they are not runtime objects,
and so cannot have a ui:field
attribute.)
For example:
<g:DockLayoutPanel unit='EM'> <g:north size='5'> <g:Label>Top</g:Label> </g:north> <g:center> <g:Label>Body</g:Label> </g:center> <g:west size='192'> <g:HTML> <ul> <li>Sidebar</li> <li>Sidebar</li> <li>Sidebar</li> </ul> </g:HTML> </g:west> </g:DockLayoutPanel>
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DockLayoutPanel.Direction | Used in addEast(Widget, double) et al to specify
the direction in which a child widget will be added. |
||||||||||
DockLayoutPanel.LayoutData | Layout data associated with each widget. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty dock panel.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a widget at the center of the dock.
| |||||||||||
Adds a widget to the east edge of the dock.
| |||||||||||
Adds a widget to the end of the line.
| |||||||||||
Adds a widget to the start of the line.
| |||||||||||
Adds a widget to the north edge of the dock.
| |||||||||||
Adds a widget to the south edge of the dock.
| |||||||||||
Adds a widget to the west edge of the dock.
| |||||||||||
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.
| |||||||||||
Gets the layout direction of the given child widget.
| |||||||||||
Adds a widget to the east edge of the dock, inserting it before an existing
widget.
| |||||||||||
Adds a widget to the start of the line, inserting it before an existing
widget.
| |||||||||||
Adds a widget to the end of the line, inserting it before an existing
widget.
| |||||||||||
Adds a widget to the north edge of the dock, inserting it before an
existing widget.
| |||||||||||
Adds a widget to the south edge of the dock, inserting it before an
existing widget.
| |||||||||||
Adds a widget to the west edge of the dock, inserting it before an existing
widget.
| |||||||||||
This method must be called whenever the implementor's size has been
modified.
| |||||||||||
Removes a child widget.
| |||||||||||
Updates the size of the widget passed in as long as it is not the center
widget and updates the layout of the dock.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Resolve the specified direction based on the current locale.
| |||||||||||
Adds a widget to the specified edge of the dock.
| |||||||||||
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 dock panel.
unit | the unit to be used for layout |
---|
Adds a widget at the center of the dock. No further widgets may be added after this one.
widget | the widget to be added |
---|
Adds a widget to the east edge of the dock.
widget | the widget to be added |
---|---|
size | the child widget's size |
Adds a widget to the end of the line. In LTR mode, the widget is added to the east. In RTL mode, the widget is added to the west.
widget | the widget to be added |
---|---|
size | the child widget's size |
Adds a widget to the start of the line. In LTR mode, the widget is added to the west. In RTL mode, the widget is added to the east.
widget | the widget to be added |
---|---|
size | the child widget's size |
Adds a widget to the north edge of the dock.
widget | the widget to be added |
---|---|
size | the child widget's size |
Adds a widget to the south edge of the dock.
widget | the widget to be added |
---|---|
size | the child widget's size |
Adds a widget to the west edge of the dock.
widget | the widget to be added |
---|---|
size | the child widget's size |
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, animating over the specified period of time.
duration | the animation duration, in milliseconds |
---|
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.
Gets the layout direction of the given child widget.
child | the widget to be queried |
---|
null
if it is not a
child of this panel
Adds a widget to the east edge of the dock, inserting it before an existing widget.
widget | the widget to be added |
---|---|
size | the child widget's size |
before | the widget before which to insert the new child, or
null to append
|
Adds a widget to the start of the line, inserting it before an existing widget. In LTR mode, the widget is added to the east. In RTL mode, the widget is added to the west.
widget | the widget to be added |
---|---|
size | the child widget's size |
before | the widget before which to insert the new child, or
null to append
|
Adds a widget to the end of the line, inserting it before an existing widget. In LTR mode, the widget is added to the west. In RTL mode, the widget is added to the east.
widget | the widget to be added |
---|---|
size | the child widget's size |
before | the widget before which to insert the new child, or
null to append
|
Adds a widget to the north edge of the dock, inserting it before an existing widget.
widget | the widget to be added |
---|---|
size | the child widget's size |
before | the widget before which to insert the new child, or
null to append
|
Adds a widget to the south edge of the dock, inserting it before an existing widget.
widget | the widget to be added |
---|---|
size | the child widget's size |
before | the widget before which to insert the new child, or
null to append
|
Adds a widget to the west edge of the dock, inserting it before an existing widget.
widget | the widget to be added |
---|---|
size | the child widget's size |
before | the widget before which to insert the new child, or
null to append
|
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
Updates the size of the widget passed in as long as it is not the center widget and updates the layout of the dock.
widget | the widget that needs to update its size |
---|---|
size | the size to update the widget to |
Resolve the specified direction based on the current locale. If the
direction is LINE_START
or LINE_END
,
the return value will be one of EAST
or
WEST
depending on the RTL mode of the locale. For all
other directions, the specified value is returned.
direction | the specified direction |
---|
Adds a widget to the specified edge of the dock. If the widget is already a
child of this panel, this method behaves as though remove(Widget)
had already been called.
widget | the widget to be added |
---|---|
direction | the widget's direction in the dock |
before | the widget before which to insert the new child, or
null to append
|
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.