Class SimpleContainer

  extended by
      extended by
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.container.Container
                  extended by com.sencha.gxt.widget.core.client.container.ResizeContainer
                      extended by com.sencha.gxt.widget.core.client.container.SimpleContainer
All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, AcceptsOneWidget, HasOneWidget, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, ProvidesResize, RequiresResize, HasLayout, AddEvent.HasAddHandlers, BeforeAddEvent.HasBeforeAddHandlers, BeforeHideEvent.HasBeforeHideHandlers, BeforeRemoveEvent.HasBeforeRemoveHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, ContainerHandler.HasContainerHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, RemoveEvent.HasRemoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, HasFocusSupport, HasItemId, Iterable<Widget>
Direct Known Subclasses:
AdapterField, BorderLayoutContainer, ButtonGroup, CenterLayoutContainer, ContentPanel, FieldLabel, FieldSet, FormPanel, NorthSouthContainer, Popup, Viewport

public class SimpleContainer
extends ResizeContainer
implements HasOneWidget

SimpleContainer takes one child and sizes it to match the container size.

Code Snippet:

  public void onModuleLoad() {
    SimpleContainer c = new SimpleContainer();
    c.add(new Label("Hello world"));

Nested Class Summary
Nested classes/interfaces inherited from class
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
Nested classes/interfaces inherited from interface
Nested classes/interfaces inherited from interface
Field Summary
Fields inherited from class
Constructor Summary
          Creates a simple container.
Method Summary
 void add(Widget child)
          Adds the specified widget to the container.
 void add(Widget child, MarginData layoutData)
          Adds a widget to the simple layout container with the specified layout parameters.
 Widget getWidget()
 boolean isResize()
          Returns true if the child widget is resized to container size.
 void setResize(boolean resize)
          True to resize the child widget to match the container size (defaults to true).
 void setWidget(IsWidget w)
 void setWidget(Widget w)
Methods inherited from class com.sencha.gxt.widget.core.client.container.ResizeContainer
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
Methods inherited from class com.sencha.gxt.widget.core.client.container.Container
add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, disable, enable, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
Methods inherited from class
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
Methods inherited from class
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public SimpleContainer()
Creates a simple container.

Method Detail


public void add(Widget child)
Description copied from class: Container
Adds the specified widget to the container.

If you override this method, please see Panel.add(Widget) for a number of things you must take into consideration.

Specified by:
add in interface HasWidgets
add in class Container
child - the child widget to be added.


public void add(Widget child,
                                    MarginData layoutData)
Adds a widget to the simple layout container with the specified layout parameters.

child - the widget to add to the layout container
layoutData - the parameters that describe how to lay out the widget


public Widget getWidget()
Specified by:
getWidget in interface HasOneWidget


public boolean isResize()
Returns true if the child widget is resized to container size.

true if resizing


public void setResize(boolean resize)
True to resize the child widget to match the container size (defaults to true).

resize - true to resize


public void setWidget(IsWidget w)
Specified by:
setWidget in interface AcceptsOneWidget


public void setWidget(Widget w)
Specified by:
setWidget in interface HasOneWidget

Copyright © 2012. All Rights Reserved.