public class

SplitLayoutPanel

extends DockLayoutPanel
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
             ↳ com.google.gwt.user.client.ui.SplitLayoutPanel

Class Overview

A panel that adds user-positioned splitters between each of its child widgets.

This panel is used in the same way as DockLayoutPanel, except that its children's sizes are always specified in PX units, and each pair of child widgets has a splitter between them that the user can drag.

This widget will only work in standards mode, which requires that the HTML page in which it is run have an explicit <!DOCTYPE> declaration.

CSS Style Rules

  • .gwt-SplitLayoutPanel { the panel itself }
  • .gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-HDragger { horizontal dragger }
  • .gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-VDragger { vertical dragger }

Example

{@example com.google.gwt.examples.SplitLayoutPanelExample}

Summary

[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Public Constructors
SplitLayoutPanel()
Construct a new SplitLayoutPanel with the default splitter size of 8px.
SplitLayoutPanel(int splitterSize)
Construct a new SplitLayoutPanel with the specified splitter size in pixels.
Public Methods
int getSplitterSize()
Return the size of the splitter in pixels.
void insert(Widget child, DockLayoutPanel.Direction direction, double size, Widget before)
Adds a widget to the specified edge of the dock.
boolean remove(Widget child)
Removes a child widget.
void setWidgetMinSize(Widget child, int minSize)
Sets the minimum allowable size for the given widget.
[Expand]
Inherited Methods
From class com.google.gwt.user.client.ui.DockLayoutPanel
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

Public Constructors

public SplitLayoutPanel ()

Construct a new SplitLayoutPanel with the default splitter size of 8px.

public SplitLayoutPanel (int splitterSize)

Construct a new SplitLayoutPanel with the specified splitter size in pixels.

Parameters
splitterSize the size of the splitter in pixels

Public Methods

public int getSplitterSize ()

Return the size of the splitter in pixels.

Returns
  • the splitter size

public void insert (Widget child, DockLayoutPanel.Direction direction, double size, Widget before)

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.

Parameters
child 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

public boolean remove (Widget child)

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.

  1. Validate: Make sure this Panel is actually the parent of the child Widget; return false if it is not.
  2. Orphan: Call orphan(Widget) first while the child Widget is still attached.
  3. Physical Detach: Adjust the DOM to account for the removal of the child Widget. The Widget's Element must be physically removed from the DOM.
  4. Logical Detach: Update the Panel's state variables to reflect the removal of the child Widget. Example: the Widget is removed from the Panel's WidgetCollection.

Parameters
child the widget to be removed
Returns
  • true if the child was present

public void setWidgetMinSize (Widget child, int minSize)

Sets the minimum allowable size for the given widget.

Its associated splitter cannot be dragged to a position that would make it smaller than this size. This method has no effect for the CENTER widget.

Parameters
child the child whose minimum size will be set
minSize the minimum size for this widget