Class CellPanel

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, Iterable<Widget>
Direct Known Subclasses:
DockPanel, HorizontalPanel, VerticalPanel

public abstract class CellPanel extends ComplexPanel
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.

Note: This class is not related to the Cell based data presentation widgets such as CellList and CellTable.

Use in UiBinder Templates

When working with CellPanel subclasses in UiBinder templates, wrap child widgets in <g:cell> elements. (Note the lower case "c", meant to signal that the cell is not a runtime object, and so cannot have a ui:field attribute.) Cell elements can have attributes setting their height, width and alignment.

<g:cell> attributes

horizontalAlignment
Interpreted as a static member of HasHorizontalAlignment.HorizontalAlignmentConstant and used as the align argument to setCellHorizontalAlignment(com.google.gwt.user.client.ui.Widget, com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant)
verticalAlignment
Interpreted as a static member of HasVerticalAlignment.VerticalAlignmentConstant and used as the align argument to setCellVerticalAlignment(com.google.gwt.user.client.ui.Widget, com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant)
width
Used as the width argument to setCellWidth(com.google.gwt.user.client.ui.Widget, java.lang.String)
height
Used as the height argument to setCellHeight(com.google.gwt.user.client.ui.Widget, java.lang.String)

For example:

 <g:HorizontalPanel>
   <g:cell width='5em' horizontalAlignment='ALIGN_RIGHT'>
     <g:Label ui:field='leftSide' />
   </g:cell>
   <g:cell width='15em' horizontalAlignment='ALIGN_LEFT'>
     <g:Label ui:field='rightSide' />
   </g:cell>
 </g:HorizontalPanel>