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

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.google.gwt.user.client.ui.ComplexPanel
                  extended by com.google.gwt.user.client.ui.CellPanel
                      extended by com.google.gwt.user.client.ui.VerticalPanel
All Implemented Interfaces:
EventListener, HasAlignment, HasHorizontalAlignment, HasVerticalAlignment, HasWidgets, IndexedPanel

public class VerticalPanel
extends CellPanel
implements IndexedPanel, HasAlignment

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


Nested Class Summary
 
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 interface com.google.gwt.user.client.ui.HasHorizontalAlignment
ALIGN_CENTER, 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.
 Widget getWidget(int index)
          Gets the child widget at the specified index.
 int getWidgetCount()
          Gets the number of child widgets in this panel.
 int getWidgetIndex(Widget child)
          Gets the index of the specified child widget.
 void insert(Widget w, int beforeIndex)
          Inserts a widget before the specified index.
 boolean remove(int index)
          Removes the widget at the specified 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, setCellVerticalAlignment, setCellWidth, setSpacing
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, getChildren, insert, iterator
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
adopt, clear, disown, onAttach, onDetach
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onBrowserEvent, onLoad, removeFromParent
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getTitle, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setTitle, setVisible, setVisible, setWidth, sinkEvents, 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.

Specified by:
add in interface HasWidgets
Overrides:
add in class Panel
Parameters:
w - the widget to be added

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.

getWidget

public Widget getWidget(int index)
Description copied from interface: IndexedPanel
Gets the child widget at the specified index.

Specified by:
getWidget in interface IndexedPanel
Parameters:
index - the child widget's index
Returns:
the child widget

getWidgetCount

public int getWidgetCount()
Description copied from interface: IndexedPanel
Gets the number of child widgets in this panel.

Specified by:
getWidgetCount in interface IndexedPanel
Returns:
the number of children

getWidgetIndex

public int getWidgetIndex(Widget child)
Description copied from interface: IndexedPanel
Gets the index of the specified child widget.

Specified by:
getWidgetIndex in interface IndexedPanel
Parameters:
child - the widget to be found
Returns:
the widget's index, or -1 if it is not a child of this panel

insert

public void insert(Widget w,
                   int beforeIndex)
Inserts a widget before 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(int index)
Description copied from interface: IndexedPanel
Removes the widget at the specified index.

Specified by:
remove in interface IndexedPanel
Parameters:
index - the index of the widget to be removed
Returns:
false if the widget is not present

remove

public boolean remove(Widget w)
Description copied from interface: HasWidgets
Removes a child widget.

Specified by:
remove in interface HasWidgets
Overrides:
remove in class ComplexPanel
Parameters:
w - the widget to be removed
Returns:
true if the widget 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, or HasHorizontalAlignment.ALIGN_RIGHT).
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)