## com.google.gwt.user.client.ui
Class VerticalPanel

    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.CellPanel
                          com.google.gwt.user.client.ui.VerticalPanel

All Implemented Interfaces:
  HasHandlers, EventListener, HasAlignment, HasHorizontalAlignment, HasVerticalAlignment, HasWidgets, IndexedPanel, java.lang.Iterable<Widget>

    public class VerticalPanel

extends CellPanel
implements HasAlignment

A panel that lays all of its widgets out in a single vertical column.

Nested Class Summary

Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
`UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled`

Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
`HasHorizontalAlignment.HorizontalAlignmentConstant`

Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
`HasVerticalAlignment.VerticalAlignmentConstant`

Field Summary

Fields inherited from class com.google.gwt.user.client.ui.UIObject
`DEBUG_ID_PREFIX`

Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
`ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT`

Fields inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment
`ALIGN_BOTTOM, ALIGN_MIDDLE, ALIGN_TOP`

Constructor Summary
`VerticalPanel()` Creates an empty vertical panel.

Method Summary
`void` | `add(Widget w)` Adds a child widget to the panel.
`HasHorizontalAlignment.HorizontalAlignmentConstant` | `getHorizontalAlignment()` Gets the horizontal alignment.
`HasVerticalAlignment.VerticalAlignmentConstant` | `getVerticalAlignment()` Gets the vertical alignment.
`void` | `insert(Widget w, int beforeIndex)` Inserts a widget before the specified index.
`protected void` | `onEnsureDebugId(java.lang.String baseID)` Affected Elements: -# = the cell at the given index.
`boolean` | `remove(Widget w)` Removes a child widget.
`void` | `setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)` Sets the default horizontal alignment to be used for widgets added to this panel.
`void` | `setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant align)` Sets the default vertical alignment to be used for widgets added to this panel.

Methods inherited from class com.google.gwt.user.client.ui.CellPanel
`getBody, getSpacing, getTable, setBorderWidth, setCellHeight, setCellHorizontalAlignment, setCellHorizontalAlignment, setCellVerticalAlignment, setCellVerticalAlignment, setCellWidth, setSpacing`

Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
`add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, insert, insert, iterator, remove`

Methods inherited from class com.google.gwt.user.client.ui.Panel
`adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan`

Methods inherited from class com.google.gwt.user.client.ui.Widget
`addDomHandler, addHandler, delegateEvent, fireEvent, getHandlerCount, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, sinkEvents`

Methods inherited from class com.google.gwt.user.client.ui.UIObject

`addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### VerticalPanel

    public VerticalPanel()

  Creates an empty vertical panel.

Method Detail

### add

    public void add(Widget w)

  Adds a child widget to the panel. If the Widget is already attached to the VerticalPanel, it will be moved to the end of the panel.

  Specified by:
    `add` in interface `HasWidgets`
  Overrides:
    `add` in class `Panel`
  Parameters:
    `w` - the widget to be added
  See Also:
    `HasWidgets.add(Widget)`

### getHorizontalAlignment

    public HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()

  Description copied from interface: `HasHorizontalAlignment`
  Gets the horizontal alignment.

  Specified by:
    `getHorizontalAlignment` in interface `HasHorizontalAlignment`
  Returns:
    the current horizontal alignment.

### getVerticalAlignment

    public HasVerticalAlignment.VerticalAlignmentConstant getVerticalAlignment()

  Description copied from interface: `HasVerticalAlignment`
  Gets the vertical alignment.

  Specified by:
    `getVerticalAlignment` in interface `HasVerticalAlignment`
  Returns:
    the current vertical alignment.

### insert

    public void insert(Widget w,
                       int beforeIndex)

  Inserts a widget before the specified index. If the Widget is already attached to the VerticalPanel, it will be moved to the specified index.

  Parameters:
    `w` - the widget to be inserted
    `beforeIndex` - the index before which it will be inserted
  Throws:
    `java.lang.IndexOutOfBoundsException` - if `beforeIndex` is out of range

### remove

    public boolean remove(Widget w)

  Description copied from class: `Panel`
  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 `Panel.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`.

  Specified by:
    `remove` in interface `HasWidgets`
  Overrides:
    `remove` in class `ComplexPanel`
  Parameters:
    `w` - the widget to be removed
  Returns:
    `true` if the child was present

### setHorizontalAlignment

    public void setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant align)

  Sets the default horizontal alignment to be used for widgets added to this panel. It only applies to widgets added after this property is set.

  Specified by:
    `setHorizontalAlignment` in interface `HasHorizontalAlignment`
  Parameters:
    `align` - the horizontal alignment ( `HasHorizontalAlignment.ALIGN_LEFT`, `HasHorizontalAlignment.ALIGN_CENTER`, `HasHorizontalAlignment.ALIGN_RIGHT`), or `HasHorizontalAlignment.ALIGN_DEFAULT`).
  See Also:
    `HasHorizontalAlignment.setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant)`

### setVerticalAlignment

    public void setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant align)

  Sets the default vertical alignment to be used for widgets added to this panel. It only applies to widgets added after this property is set.

  Specified by:
    `setVerticalAlignment` in interface `HasVerticalAlignment`
  Parameters:
    `align` - the vertical alignment ( `HasVerticalAlignment.ALIGN_TOP`, `HasVerticalAlignment.ALIGN_MIDDLE`, or `HasVerticalAlignment.ALIGN_BOTTOM`).
  See Also:
    `HasVerticalAlignment.setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant)`

### onEnsureDebugId

    protected void onEnsureDebugId(java.lang.String baseID)

  Affected Elements:
  - -# = the cell at the given index.

  Overrides:
    `onEnsureDebugId` in class `UIObject`
  Parameters:
    `baseID` - the base ID used by the main element
  See Also:
    `UIObject.onEnsureDebugId(String)`