Class CellPanel

public class CellPanel
extends ComplexPanel

// Superclass of VerticalPanel, HorizontalPanel, DockPanel
A panel whose child widgets are contained within the cells of a table. Each cell's size may be set independently. Each child widget can take up a subset of its cell and can be aligned within it.

Constructors

CellPanel()

Methods

getSpacing()Gets the amount of spacing between this panel's cells.
getTable()Accessor for subclasses to get this panel's table element.
setBorderWidth(int)Sets the width of the border to be applied to all cells in this panel.
setCellHeight(Widget, String)Sets the height of the cell associated with the given widget, related to the panel as a whole.
setCellHorizontalAlignment(Widget, HasHorizontalAlignment.HorizontalAlignmentConstant)Sets the horizontal alignment of the given widget within its cell
setCellVerticalAlignment(Widget, HasVerticalAlignment.VerticalAlignmentConstant)Sets the vertical alignment of the given widget within its cell
setCellWidth(Widget, String)Sets the width of the cell associated with the given widget, related to the panel as a whole.
setSpacing(int)Sets the amount of spacing between this panel's cells.

Constructor Detail

CellPanel

protected CellPanel()

Method Detail

getSpacing

public int getSpacing()
Gets the amount of spacing between this panel's cells.

Return Value

the inter-cell spacing, in pixels

getTable

protected Element getTable()
Accessor for subclasses to get this panel's table element.

Return Value

the cell panel's table element

setBorderWidth

public void setBorderWidth(int width)
Sets the width of the border to be applied to all cells in this panel. This is particularly useful when debugging layouts, in that it allows you to see explicitly the cells that contain this panel's children.

Parameters

width
the width of the panel's cell borders, in pixels

setCellHeight

public abstract void setCellHeight(Widget w, String height)
Sets the height of the cell associated with the given widget, related to the panel as a whole.

Parameters

w
the widget whose cell height is to be set
height
the cell's height, in CSS units

setCellHorizontalAlignment

public abstract void setCellHorizontalAlignment(Widget w, HasHorizontalAlignment.HorizontalAlignmentConstant align)
Sets the horizontal alignment of the given widget within its cell

Parameters

w
the widget whose horizontal alignment is to be set
align
the widget's horizontal alignment, as defined in HasHorizontalAlignment.

setCellVerticalAlignment

public abstract void setCellVerticalAlignment(Widget w, HasVerticalAlignment.VerticalAlignmentConstant align)
Sets the vertical alignment of the given widget within its cell

Parameters

w
the widget whose vertical alignment is to be set
align
the widget's vertical alignment, as defined in HasVerticalAlignment.

setCellWidth

public abstract void setCellWidth(Widget w, String width)
Sets the width of the cell associated with the given widget, related to the panel as a whole.

Parameters

w
the widget whose cell width is to be set
width
the cell's width, in CSS units

setSpacing

public void setSpacing(int spacing)
Sets the amount of spacing between this panel's cells.

Parameters

spacing
the inter-cell spacing, in pixels