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 |
Known Direct Subclasses |
A widget that can contain arbitrary HTML. This widget uses a <div> element, causing it to be displayed with block 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.
setDirectionEstimator(boolean)
or
passing a DirectionEstimator parameter to the constructor, and is off by
default.
[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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty HTML widget.
| |||||||||||
Initializes the widget's HTML from a given
SafeHtml object. | |||||||||||
Creates an HTML widget with the specified contents and with the specified
direction.
| |||||||||||
Creates an HTML widget with the specified HTML contents and specifies a
direction estimator.
| |||||||||||
Creates an HTML widget with the specified HTML contents.
| |||||||||||
Creates an HTML widget with the specified HTML contents and with the
specified direction.
| |||||||||||
Creates an HTML widget with the specified contents, optionally treating it
as HTML, and optionally disabling word wrapping.
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This constructor may be used by subclasses to explicitly use an existing
element.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets this object's contents as HTML.
| |||||||||||
Sets the label's content to the given HTML, applying the given direction.
| |||||||||||
Sets this object's html, also declaring its direction.
| |||||||||||
Sets this object's contents via known-safe HTML.
| |||||||||||
Sets the label's content to the given HTML.
| |||||||||||
Creates an HTML widget that wraps an existing <div> or <span>
element.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty HTML widget.
Initializes the widget's HTML from a given SafeHtml
object.
html | the new widget's HTML contents |
---|
Creates an HTML widget with the specified contents and with the specified direction.
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.
|
Creates an HTML widget with the specified HTML contents and specifies a direction estimator.
html | the new widget's SafeHtml contents |
---|---|
directionEstimator | A DirectionEstimator object used for automatic
direction adjustment. For convenience,
DEFAULT_DIRECTION_ESTIMATOR can be used.
|
Creates an HTML widget with the specified HTML contents.
html | the new widget's HTML contents |
---|
Creates an HTML widget with the specified HTML contents and with the specified direction.
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.
|
Creates an HTML widget with the specified contents, optionally treating it as HTML, and optionally disabling word wrapping.
html | the widget's contents |
---|---|
wordWrap | false to disable word wrapping
|
This constructor may be used by subclasses to explicitly use an existing element. This element must be either a <div> or <span> element.
element | the element to be used |
---|
Sets the label's content to the given HTML, applying the given direction.
See
setText(String, Direction)
for details on potential effects on alignment.
html | the new widget's HTML content |
---|---|
dir | the content's direction. Note: Direction.DEFAULT means
direction should be inherited from the widget's parent element.
|
Sets this object's html, also declaring its direction.
html | the object's new html |
---|---|
dir | the html's direction |
Sets this object's contents via known-safe HTML.
html | the html to set. |
---|
Sets the label's content to the given HTML.
See setText(String)
for details on potential effects on direction
and alignment.
html | the new widget's HTML content |
---|
Creates an HTML 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)
.
element | the element to be wrapped |
---|