Example usage for com.google.gwt.user.client.ui HasHTML setHTML

List of usage examples for com.google.gwt.user.client.ui HasHTML setHTML

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HasHTML setHTML.

Prototype

void setHTML(String html);

Source Link

Document

Sets this object's contents via HTML.

Usage

From source file:com.vaadin.client.VCaption.java

License:Apache License

/**
 * Sets the text of the given widget to the caption found in the state.
 * <p>//from   w w w  .j  a  v a2s .c om
 * Uses {@link AbstractComponentState#captionAsHtml} to determine whether to
 * set the caption as html or plain text
 * 
 * @since 7.4
 * @param widget
 *            the target widget
 * @param state
 *            the state from which to read the caption text and mode
 */
public static void setCaptionText(HasHTML widget, AbstractComponentState state) {
    if (state.captionAsHtml) {
        widget.setHTML(state.caption);
    } else {
        widget.setText(state.caption);
    }

}