com.sencha.gxt.widget.core.client.container
Class SimpleContainer

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          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"));
    RootPanel.get().add(c);
  }
 


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
SimpleContainer()
          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 com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
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

SimpleContainer

public SimpleContainer()
Creates a simple container.

Method Detail

add

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
Overrides:
add in class Container
Parameters:
child - the child widget to be added.

add

@UiChild(limit=1,
         tagname="child")
public void add(Widget child,
                                    MarginData layoutData)
Adds a widget to the simple layout container with the specified layout parameters.

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

getWidget

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

isResize

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

Returns:
true if resizing

setResize

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

Parameters:
resize - true to resize

setWidget

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

setWidget

@UiChild(limit=1,
         tagname="widget")
public void setWidget(Widget w)
Specified by:
setWidget in interface HasOneWidget


Copyright © 2012. All Rights Reserved.