Package com.google.gwt.user.client.ui
Class CellPanel
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
- All Implemented Interfaces:
- HasAttachHandlers,- HasHandlers,- EventListener,- HasVisibility,- HasWidgets,- HasWidgets.ForIsWidget,- IndexedPanel,- IndexedPanel.ForIsWidget,- IsWidget,- Iterable<Widget>
- Direct Known Subclasses:
- DockPanel,- HorizontalPanel,- VerticalPanel
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.HorizontalAlignmentConstantand used as thealignargument tosetCellHorizontalAlignment(com.google.gwt.user.client.ui.Widget, com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant)
- verticalAlignment
- Interpreted as a static member of HasVerticalAlignment.VerticalAlignmentConstantand used as thealignargument tosetCellVerticalAlignment(com.google.gwt.user.client.ui.Widget, com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant)
- width
- Used as the widthargument tosetCellWidth(com.google.gwt.user.client.ui.Widget, java.lang.String)
- height
- Used as the heightargument tosetCellHeight(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>
 - 
Nested Class SummaryNested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObjectUIObject.DebugIdImpl, UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgetsHasWidgets.ForIsWidgetNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanelIndexedPanel.ForIsWidget
- 
Field SummaryFields inherited from class com.google.gwt.user.client.ui.WidgeteventsToSinkFields inherited from class com.google.gwt.user.client.ui.UIObjectDEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected ElementgetBody()intGets the amount of spacing between this panel's cells.protected ElementgetTable()(package private) ElementvoidsetBorderWidth(int width) Sets the width of the border to be applied to all cells in this panel.voidsetCellHeight(IsWidget w, String height) Overloaded version for IsWidget.voidsetCellHeight(Widget w, String height) Sets the height of the cell associated with the given widget, related to the panel as a whole.protected voidprotected voidDeprecated.voidOverloaded version for IsWidget.voidSets the horizontal alignment of the given widget within its cell.protected voidprotected voidDeprecated.Call and overridesetCellVerticalAlignment(Element, VerticalAlignmentConstant)instead.voidOverloaded version for IsWidget.voidSets the vertical alignment of the given widget within its cell.voidsetCellWidth(IsWidget w, String width) Overloaded version for IsWidget.voidsetCellWidth(Widget w, String width) Sets the width of the cell associated with the given widget, related to the panel as a whole.voidsetSpacing(int spacing) Sets the amount of spacing between this panel's cells.Methods inherited from class com.google.gwt.user.client.ui.ComplexPaneladd, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, doLogicalClear, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeMethods inherited from class com.google.gwt.user.client.ui.Paneladd, add, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeMethods inherited from class com.google.gwt.user.client.ui.WidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObjectaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
CellPanelpublic CellPanel()
 
- 
- 
Method Details- 
getSpacingpublic int getSpacing()Gets the amount of spacing between this panel's cells.- Returns:
- the inter-cell spacing, in pixels
 
- 
setBorderWidthpublic 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
 
- 
setCellHeightSets 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
 
- 
setCellHeightOverloaded version for IsWidget.- See Also:
 
- 
setCellHorizontalAlignmentpublic 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.
 
- 
setCellHorizontalAlignmentpublic void setCellHorizontalAlignment(IsWidget w, HasHorizontalAlignment.HorizontalAlignmentConstant align) Overloaded version for IsWidget.- See Also:
 
- 
setCellVerticalAlignmentpublic 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.
 
- 
setCellVerticalAlignmentpublic void setCellVerticalAlignment(IsWidget w, HasVerticalAlignment.VerticalAlignmentConstant align) Overloaded version for IsWidget.- See Also:
 
- 
setCellWidthSets 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
 
- 
setCellWidthOverloaded version for IsWidget.- See Also:
 
- 
setSpacingpublic void setSpacing(int spacing) Sets the amount of spacing between this panel's cells.- Parameters:
- spacing- the inter-cell spacing, in pixels
 
- 
getBody
- 
getTable
- 
setCellHorizontalAlignmentprotected void setCellHorizontalAlignment(Element td, HasHorizontalAlignment.HorizontalAlignmentConstant align) 
- 
setCellHorizontalAlignment@Deprecated protected void setCellHorizontalAlignment(Element td, HasHorizontalAlignment.HorizontalAlignmentConstant align) Deprecated.Call and overridesetCellHorizontalAlignment(Element, HorizontalAlignmentConstant)instead.
- 
setCellVerticalAlignmentprotected void setCellVerticalAlignment(Element td, HasVerticalAlignment.VerticalAlignmentConstant align) 
- 
setCellVerticalAlignment@Deprecated protected void setCellVerticalAlignment(Element td, HasVerticalAlignment.VerticalAlignmentConstant align) Deprecated.Call and overridesetCellVerticalAlignment(Element, VerticalAlignmentConstant)instead.
- 
getWidgetTd
 
- 
setCellHorizontalAlignment(Element, HorizontalAlignmentConstant)instead.