com.extjs.gxt.ui.client.widget
Class HtmlContainer

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.Container<Component>
                      extended by com.extjs.gxt.ui.client.widget.HtmlContainer
All Implemented Interfaces:
Observable, com.google.gwt.user.client.EventListener

public class HtmlContainer
extends Container<Component>

A specialized container whose contents can be specified as an existing element, an html fragment, or a remote url. When adding children a css selector is used to identify the element the child will be inserted into.

 

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 boolean deferDownload
          True to defer remote requests until the component is rendered (defauls to false).
 com.google.gwt.http.client.RequestBuilder.Method httpMethod
          The method used when requesting remote content (defaults to RequestBuilder.GET).
 java.lang.String requestData
          The request data to be used in remote calls (defaults to null).
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
HtmlContainer()
          Creates a new container.
HtmlContainer(com.google.gwt.user.client.Element elem)
          Creates a new container.
HtmlContainer(com.google.gwt.http.client.RequestBuilder requestBuilder)
          Creates a new container.
HtmlContainer(java.lang.String html)
          Creates a container.
 
Method Summary
 void add(com.google.gwt.user.client.ui.Widget widget, java.lang.String selector)
          Adds a component to this Container.
 java.lang.String getTagName()
           
 void setHtml(java.lang.String html)
          Sets the container's inner html.
 void setTagName(java.lang.String tagName)
          The HTML tag name that will wrap the text (defaults to 'div').
 void setUrl(java.lang.String url)
          Retrieves and sets the container's content from the given url.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Container
disable, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getWidget, indexOf, iterator, removeAll, scrollIntoView
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
getBounds, getHeight, getHeight, getPosition, getShadow, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShim, setSize, setSize, setWidth, setWidth
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, disableEvents, disableTextSelection, el, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getData, getData, getElement, getId, getItemId, getModel, getState, getToolTip, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isVisible, onBrowserEvent, onComponentEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeWidgetListener, render, render, saveState, setBorders, setData, setData, setElement, setEnabled, setEnableState, setId, setIntStyleAttribute, setItemId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, show, sinkEvents, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

httpMethod

public com.google.gwt.http.client.RequestBuilder.Method httpMethod
The method used when requesting remote content (defaults to RequestBuilder.GET). Only applies when specifying a setUrl(String) .


deferDownload

public boolean deferDownload
True to defer remote requests until the component is rendered (defauls to false).


requestData

public java.lang.String requestData
The request data to be used in remote calls (defaults to null).

Constructor Detail

HtmlContainer

public HtmlContainer()
Creates a new container.


HtmlContainer

public HtmlContainer(com.google.gwt.user.client.Element elem)
Creates a new container.

Parameters:
elem - the component's element

HtmlContainer

public HtmlContainer(com.google.gwt.http.client.RequestBuilder requestBuilder)
Creates a new container.

Parameters:
requestBuilder - the request to be used when setting a url

HtmlContainer

public HtmlContainer(java.lang.String html)
Creates a container.

Parameters:
html - the containers inner html
Method Detail

add

public void add(com.google.gwt.user.client.ui.Widget widget,
                java.lang.String selector)
Adds a component to this Container. Fires the BeforeAdd event before adding, then fires the Add event after the component has been added.

Parameters:
widget - the widget to add. If the widget is not a Component it will be wrapped in a WidgetComponent
selector - the css selector used to identify the components parent

getTagName

public java.lang.String getTagName()
Returns:
the tagName

setHtml

public void setHtml(java.lang.String html)
Sets the container's inner html.

Parameters:
html - the html

setTagName

public void setTagName(java.lang.String tagName)
The HTML tag name that will wrap the text (defaults to 'div'). For inline behavior set the tag name to 'span'.

Parameters:
tagName - the new tag name

setUrl

public void setUrl(java.lang.String url)
Retrieves and sets the container's content from the given url.

Parameters:
url - the url