Example usage for com.google.gwt.user.client DOM createCaption

List of usage examples for com.google.gwt.user.client DOM createCaption

Introduction

In this page you can find the example usage for com.google.gwt.user.client DOM createCaption.

Prototype

public static Element createCaption() 

Source Link

Document

Creates an HTML CAPTION element.

Usage

From source file:com.gwtmodel.table.Utils.java

License:Apache License

public static void setCaption(Widget w, String title, String attr) {
    Element e = DOM.createCaption();
    e.setInnerText(title);/*from  w  w  w  .ja v a2 s  . co  m*/
    if (attr != null) {
        e.setAttribute("class", attr);
    }
    NodeList<Node> li = w.getElement().getChildNodes();
    li.getItem(0);
    w.getElement().insertBefore(e, li.getItem(0));
}

From source file:gwtBlocks.client.views.WidgetFactory.java

License:Apache License

public static final HTMLTable addCaption(HTMLTable table, String caption) {
    if (caption == null)
        return table;

    Element captionEle = DOM.createCaption();
    DOM.setInnerText(captionEle, caption);
    DOM.appendChild(table.getElement(), captionEle);

    return table;
}