GWT DockLayoutPanel

In this layout panel, all its child widgets lays at corner or edges. The last widget occupies the center space. It works also in standard mode where HTML page is having !DOCTYPE DECLARATION.

GWT DockLayoutPanel Class Declaration

Let's see the declaration of com.google.gwt.user.client.ui.DockLayoutPanel

DockLayoutPanel Nested Classes

ClassDescription
DockLayoutPanel.DirectionIt is used in addEast(Widget, double) et al to specify the direction in which a child widget will be added.
DockLayoutPanel.LayoutDataIts layout data is associated with each widget.

GWT DockLayoutPanel Constructors

ConstructorDescription
DockLayoutPanel(Style.Unit unit)It creates an empty dock panel.

DockLayoutPanel Common Methods

Modifier and TypesMethodDescription
voidadd(Widget widget)It adds a widget at the center of the dock.
voidaddEast(IsWidget widget, double size)It is a overloaded version for IsWidget.
voidaddEast(Widget widget, double size)It adds a widget to the east edge of the dock.
voidaddLineEnd(Widget widget, double size)It adds a widget to the end of the line.
voidaddNorth(Widget widget, double size)It adds a widget to the north edge of the dock.
voidaddSouth(Widget widget, double size)It adds a widget to the south edge of the dock.
ElementgetWidgetContainerElement(Widget child)It gets the container element wrapping the given child widget.
protected DockLayoutPanel.DirectiongetResolvedDirection(DockLayoutPanel.Direction direction)It resolves the specified direction based on the current locale.
protected voidinsert(Widget widget, DockLayoutPanel.Direction direction, double size, Widget before)It adds a widget to the specified edge of the dock.
protected voidonAttach()It is called when a widget is attached to the browser's document.
protected voidonDetach()It is called when a widget is detached from the browser's document.
voidsetWidgetHidden(Widget widget, boolean hidden)It sets whether or not the given widget should be hidden.
voidsetWidgetSize(Widget widget, double size)It updates the size of the widget passed in as long as it is not the center widget and updates the layout of the dock.

GWT DockLayoutPanel Example 1

//SampleDockLayoutPanel.java

//SampleDockLayoutPanel.css

Output:

GWT DockLayoutPanel

GWT DockLayoutPanel Example 2

//SampleDockLayoutPanel.java

Output:

GWT DockLayoutPanel



Latest Courses