## com.google.gwt.user.client.ui
Class HTMLPanel

    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.HTMLPanel

All Implemented Interfaces:
  HasHandlers, EventListener, HasWidgets, IndexedPanel, java.lang.Iterable<Widget>

    public class HTMLPanel

extends ComplexPanel

A panel that contains HTML, and which can attach child widgets to identified elements within that HTML.

Nested Class Summary

Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
`UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled`

Field Summary

Fields inherited from class com.google.gwt.user.client.ui.UIObject
`DEBUG_ID_PREFIX`

Constructor Summary
`HTMLPanel(java.lang.String html)` Creates an HTML panel with the specified HTML contents.

Method Summary
`void` | `add(Widget widget, java.lang.String id)` Adds a child widget to the panel, contained within the HTML element specified by a given id.
`void` | `addAndReplaceElement(Widget widget, java.lang.String id)` Adds a child widget to the panel, replacing the HTML element specified by a given id.
`static java.lang.String` | `createUniqueId()` A helper method for creating unique IDs for elements within dynamically- generated HTML.
`Element` | `getElementById(java.lang.String id)` Finds an `element` within this panel by its id.

Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
`add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, insert, insert, iterator, remove, remove`

Methods inherited from class com.google.gwt.user.client.ui.Panel
`add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan`

Methods inherited from class com.google.gwt.user.client.ui.Widget
`addDomHandler, addHandler, delegateEvent, fireEvent, getHandlerCount, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, sinkEvents`

Methods inherited from class com.google.gwt.user.client.ui.UIObject

`addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### HTMLPanel

    public HTMLPanel(java.lang.String html)

  Creates an HTML panel with the specified HTML contents. Any element within this HTML that has a specified id can contain a child widget.

  Parameters:
    `html` - the panel's HTML

Method Detail

### createUniqueId

    public static java.lang.String createUniqueId()

  A helper method for creating unique IDs for elements within dynamically- generated HTML. This is important because no two elements in a document should have the same id.

  Returns:
    a new unique identifier

### add

    public void add(Widget widget,
                    java.lang.String id)

  Adds a child widget to the panel, contained within the HTML element specified by a given id.

  Parameters:
    `widget` - the widget to be added
    `id` - the id of the element within which it will be contained

### addAndReplaceElement

    public void addAndReplaceElement(Widget widget,
                                     java.lang.String id)

  Adds a child widget to the panel, replacing the HTML element specified by a given id.

  Parameters:
    `widget` - the widget to be added
    `id` - the id of the element to be replaced by the widget

### getElementById

    public Element getElementById(java.lang.String id)

  Finds an `element` within this panel by its id. This method uses `Document.getElementById(String)`, so the id must still be unique within the document.

  Parameters:
    `id` - the id of the element to be found
  Returns:
    the element with the given id, or `null` if none is found