Class VerticalPanel

public class VerticalPanel
extends CellPanel
implements IndexedPanel, HasAlignment
A panel that lays all of its widgets out in a single vertical column.

Constructors

VerticalPanel()Creates an empty vertical panel.

Methods

add(Widget)Adds a child widget to the panel.
getHorizontalAlignment()Gets the horizontal alignment.
getVerticalAlignment()Gets the vertical alignment.
getWidget(int)Gets the child widget at the specified index.
getWidgetCount()Gets the number of child widgets in this panel.
getWidgetIndex(Widget)Gets the index of the specified child widget.
insert(Widget, int)Inserts a widget before the specified index.
remove(int)Removes the widget at the specified index.
remove(Widget)
setHorizontalAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant)Sets the default horizontal alignment to be used for widgets added to this panel.
setVerticalAlignment(HasVerticalAlignment.VerticalAlignmentConstant)Sets the default vertical alignment to be used for widgets added to this panel.

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.

Parameters

w
the widget to be added

getHorizontalAlignment

public HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
Gets the horizontal alignment.

Return Value

the current horizontal alignment.

getVerticalAlignment

public HasVerticalAlignment.VerticalAlignmentConstant getVerticalAlignment()
Gets the vertical alignment.

Return Value

the current vertical alignment.

getWidget

public Widget getWidget(int index)
Gets the child widget at the specified index.

Parameters

index
the child widget's index

Return Value

the child widget

getWidgetCount

public int getWidgetCount()
Gets the number of child widgets in this panel.

Return Value

the number of children

getWidgetIndex

public int getWidgetIndex(Widget child)
Gets the index of the specified child widget.

Parameters

child
the widget to be found

Return Value

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

remove

public boolean remove(int index)
Removes the widget at the specified index.

Parameters

index
the index of the widget to be removed

Return Value

false if the widget is not present

remove

public boolean remove(Widget w)

Parameters

w

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.

Parameters

align

See Also

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.

Parameters

align

See Also

VerticalAlignmentConstant)