public class

InlineHTML

extends HTML
java.lang.Object
   ↳ com.google.gwt.user.client.ui.UIObject
     ↳ com.google.gwt.user.client.ui.Widget
       ↳ com.google.gwt.user.client.ui.LabelBase<T>
         ↳ com.google.gwt.user.client.ui.Label
           ↳ com.google.gwt.user.client.ui.HTML
             ↳ com.google.gwt.user.client.ui.InlineHTML

Class Overview

A widget that can contain arbitrary HTML. This widget uses a <span> element, causing it to be displayed with inline layout.

If you only need a simple label (text, but not HTML), then the Label widget is more appropriate, as it disallows the use of HTML, which can lead to potential security issues if not used properly.

Built-in Bidi Text Support

This widget is capable of automatically adjusting its direction according to its content. This feature is controlled by setDirectionEstimator(boolean) or passing a DirectionEstimator parameter to the constructor, and is off by default.

CSS Style Rules

  • .gwt-InlineHTML { }

Summary

[Expand]
Inherited Constants
From class com.google.gwt.user.client.ui.UIObject
[Expand]
Inherited Fields
From class com.google.gwt.user.client.ui.Label
From interface com.google.gwt.user.client.ui.HasAutoHorizontalAlignment
From interface com.google.gwt.user.client.ui.HasHorizontalAlignment
Public Constructors
InlineHTML()
Creates an empty HTML widget.
InlineHTML(SafeHtml html)
Initializes the widget's HTML from a given SafeHtml object.
InlineHTML(SafeHtml html, HasDirection.Direction dir)
Creates an HTML widget with the specified contents and with the specified direction.
InlineHTML(SafeHtml html, DirectionEstimator directionEstimator)
Creates an HTML widget with the specified HTML contents and with a default direction estimator.
InlineHTML(String html)
Creates an HTML widget with the specified HTML contents.
InlineHTML(String html, HasDirection.Direction dir)
Creates an HTML widget with the specified HTML contents and with the specified direction.
Protected Constructors
InlineHTML(Element element)
This constructor may be used by subclasses to explicitly use an existing element.
Public Methods
static InlineHTML wrap(Element element)
Creates an InlineHTML widget that wraps an existing <div> or <span> element.
[Expand]
Inherited Methods
From class com.google.gwt.user.client.ui.HTML
From class com.google.gwt.user.client.ui.Label
From class com.google.gwt.user.client.ui.LabelBase
From class com.google.gwt.user.client.ui.Widget
From class com.google.gwt.user.client.ui.UIObject
From class java.lang.Object
From interface com.google.gwt.editor.client.IsEditor
From interface com.google.gwt.event.dom.client.HasClickHandlers
From interface com.google.gwt.event.dom.client.HasDoubleClickHandlers
From interface com.google.gwt.event.dom.client.HasGestureChangeHandlers
From interface com.google.gwt.event.dom.client.HasGestureEndHandlers
From interface com.google.gwt.event.dom.client.HasGestureStartHandlers
From interface com.google.gwt.event.dom.client.HasMouseDownHandlers
From interface com.google.gwt.event.dom.client.HasMouseMoveHandlers
From interface com.google.gwt.event.dom.client.HasMouseOutHandlers
From interface com.google.gwt.event.dom.client.HasMouseOverHandlers
From interface com.google.gwt.event.dom.client.HasMouseUpHandlers
From interface com.google.gwt.event.dom.client.HasMouseWheelHandlers
From interface com.google.gwt.event.dom.client.HasTouchCancelHandlers
From interface com.google.gwt.event.dom.client.HasTouchEndHandlers
From interface com.google.gwt.event.dom.client.HasTouchMoveHandlers
From interface com.google.gwt.event.dom.client.HasTouchStartHandlers
From interface com.google.gwt.event.logical.shared.HasAttachHandlers
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.i18n.client.HasDirection
From interface com.google.gwt.i18n.shared.HasDirectionEstimator
From interface com.google.gwt.safehtml.client.HasSafeHtml
From interface com.google.gwt.user.client.EventListener
From interface com.google.gwt.user.client.ui.HasAutoHorizontalAlignment
From interface com.google.gwt.user.client.ui.HasDirectionalHtml
From interface com.google.gwt.user.client.ui.HasDirectionalSafeHtml
From interface com.google.gwt.user.client.ui.HasDirectionalText
From interface com.google.gwt.user.client.ui.HasHTML
From interface com.google.gwt.user.client.ui.HasHorizontalAlignment
From interface com.google.gwt.user.client.ui.HasText
From interface com.google.gwt.user.client.ui.HasWordWrap
From interface com.google.gwt.user.client.ui.IsWidget
From interface com.google.gwt.user.client.ui.SourcesClickEvents
From interface com.google.gwt.user.client.ui.SourcesMouseEvents

Public Constructors

public InlineHTML ()

Creates an empty HTML widget.

public InlineHTML (SafeHtml html)

Initializes the widget's HTML from a given SafeHtml object.

Parameters
html the new widget's HTML contents

public InlineHTML (SafeHtml html, HasDirection.Direction dir)

Creates an HTML widget with the specified contents and with the specified direction.

Parameters
html the new widget's SafeHtml contents
dir the content's direction. Note: Direction.DEFAULT means direction should be inherited from the widget's parent element.

public InlineHTML (SafeHtml html, DirectionEstimator directionEstimator)

Creates an HTML widget with the specified HTML contents and with a default direction estimator.

Parameters
html the new widget's SafeHtml contents
directionEstimator A DirectionEstimator object used for automatic direction adjustment. For convenience, DEFAULT_DIRECTION_ESTIMATOR can be used.

public InlineHTML (String html)

Creates an HTML widget with the specified HTML contents.

Parameters
html the new widget's HTML contents

public InlineHTML (String html, HasDirection.Direction dir)

Creates an HTML widget with the specified HTML contents and with the specified direction.

Parameters
html the new widget's HTML contents
dir the content's direction. Note: Direction.DEFAULT means direction should be inherited from the widget's parent element.

Protected Constructors

protected InlineHTML (Element element)

This constructor may be used by subclasses to explicitly use an existing element. This element must be either a <div> <span> element.

Parameters
element the element to be used

Public Methods

public static InlineHTML wrap (Element element)

Creates an InlineHTML widget that wraps an existing <div> or <span> element. This element must already be attached to the document. If the element is removed from the document, you must call detachNow(Widget).

Parameters
element the element to be wrapped