public final class

VerticalSplitPanel

extends Panel
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.VerticalSplitPanel

This class is deprecated.
Use SplitLayoutPanel instead, but understand that it is not a drop in replacement for this class. It requires standards mode, and is most easily used under a RootLayoutPanel (as opposed to a RootPanel

Class Overview

A panel that arranges two widgets in a single vertical column and allows the user to interactively change the proportion of the height dedicated to each of the two widgets. Widgets contained within a VerticalSplitterPanel will be automatically decorated with scrollbars when necessary.

This widget will only work in quirks mode. If your application is in Standards Mode, use SplitLayoutPanel instead.

CSS Style Rules

  • .gwt-VerticalSplitPanel { the panel itself }
  • .gwt-VerticalSplitPanel vsplitter { the splitter }

See Also

Summary

Nested Classes
interface VerticalSplitPanel.Resources The default resources used by this widget. 
[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
Public Constructors
VerticalSplitPanel()
VerticalSplitPanel(VerticalSplitPanelImages images)
This constructor is deprecated. replaced by VerticalSplitPanel(Resources)
VerticalSplitPanel(VerticalSplitPanel.Resources resources)
Public Methods
void add(Widget w)
Adds a child widget.
Widget getBottomWidget()
Gets the widget in the bottom of the panel.
Widget getTopWidget()
Gets the widget in the top of the panel.
boolean isResizing()
Indicates whether the split panel is being resized.
Iterator<Widget> iterator()
void onBrowserEvent(Event event)
Fired whenever a browser event is received.
boolean remove(Widget widget)
Removes a child widget.
void setBottomWidget(Widget w)
Sets the widget in the bottom of the panel.
void setHeight(String height)
Sets the object's height.
void setSplitPosition(String pos)
Moves the position of the splitter.
void setTopWidget(Widget w)
Sets the widget in the top of the panel.
Protected Methods
Element getElement(int index)
Gets the content element for the given index.
Element getSplitElement()
Gets the element that is acting as the splitter.
Widget getWidget(int index)
Gets one of the contained widgets.
void onEnsureDebugId(String baseID)
Affected Elements:
  • -splitter = the container containing the splitter element.
void onLoad()
This method is called immediately after a widget becomes attached to the browser's document.
void onUnload()
This method is called immediately before a widget will be detached from the browser's document.
final void setWidget(int index, Widget w)
Sets one of the contained widgets.
[Expand]
Inherited Methods
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.IsWidget
From interface java.lang.Iterable

Public Constructors

public VerticalSplitPanel ()

public VerticalSplitPanel (VerticalSplitPanelImages images)

This constructor is deprecated.
replaced by VerticalSplitPanel(Resources)

Creates an empty vertical split panel.

public VerticalSplitPanel (VerticalSplitPanel.Resources resources)

Public Methods

public void add (Widget w)

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.

  1. Validate: Perform any sanity checks to ensure the Panel can accept a new Widget. Examples: checking for a valid index on insertion; checking that the Panel is not full if there is a max capacity.
  2. Adjust for Reinsertion: Some Panels need to handle the case where the Widget is already a child of this Panel. Example: when performing a reinsert, the index might need to be adjusted to account for the Widget's removal. See adjustIndex(Widget, int).
  3. Detach Child: Remove the Widget from its existing parent, if any. Most Panels will simply call removeFromParent() on the Widget.
  4. Logical Attach: Any state variables of the Panel should be updated to reflect the addition of the new Widget. Example: the Widget is added to the Panel's WidgetCollection at the appropriate index.
  5. Physical Attach: The Widget's Element must be physically attached to the Panel's Element, either directly or indirectly.
  6. Adopt: Call adopt(Widget) to finalize the add as the very last step.

Parameters
w the widget to be added

public Widget getBottomWidget ()

Gets the widget in the bottom of the panel.

Returns
  • the widget, null if there is not one

public Widget getTopWidget ()

Gets the widget in the top of the panel.

Returns
  • the widget, null if there is not one

public boolean isResizing ()

Indicates whether the split panel is being resized.

Returns
  • true if the user is dragging the splitter, false otherwise

public Iterator<Widget> iterator ()

public void onBrowserEvent (Event event)

Fired whenever a browser event is received.

Parameters
event the event received

public boolean remove (Widget widget)

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
widget the widget to be removed
Returns
  • true if the child was present

public void setBottomWidget (Widget w)

Sets the widget in the bottom of the panel.

Parameters
w the widget

public void setHeight (String height)

Sets the object's height. This height does not include decorations such as border, margin, and padding.

Parameters
height the object's new height, in CSS units (e.g. "10px", "1em")

public void setSplitPosition (String pos)

Moves the position of the splitter.

Parameters
pos the new size of the left region in CSS units (e.g. "10px", "1em")

public void setTopWidget (Widget w)

Sets the widget in the top of the panel.

Parameters
w the widget

Protected Methods

protected Element getElement (int index)

Gets the content element for the given index.

Parameters
index the index of the element, only 0 and 1 are valid.
Returns
  • the element

protected Element getSplitElement ()

Gets the element that is acting as the splitter.

Returns
  • the element

protected Widget getWidget (int index)

Gets one of the contained widgets.

Parameters
index the index of the widget, only 0 and 1 are valid.
Returns
  • the widget

protected void onEnsureDebugId (String baseID)

Affected Elements:

  • -splitter = the container containing the splitter element.
  • -top = the container above the splitter.
  • -bottom = the container below the splitter.

Parameters
baseID the base ID used by the main element

protected void onLoad ()

This method is called immediately after a widget becomes attached to the browser's document.

protected void onUnload ()

This method is called immediately before a widget will be detached from the browser's document.

protected final void setWidget (int index, Widget w)

Sets one of the contained widgets.

Parameters
index the index, only 0 and 1 are valid
w the widget