Example usage for com.google.gwt.user.client Element toString

List of usage examples for com.google.gwt.user.client Element toString

Introduction

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

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:com.audata.client.util.Print.java

License:Open Source License

public static void it(Element element) {
    it("", element.toString());
}

From source file:com.audata.client.util.Print.java

License:Open Source License

public static void it(String style, Element element) {
    it(style, element.toString());
}

From source file:com.edgenius.wiki.gwt.client.widgets.Button.java

License:Open Source License

public void setText(String text) {
    Element child = DOM.getChild(this.getElement(), 0);
    int txtIdx = 0;
    if (child != null && child.toString().indexOf("img") != -1) {
        //first is image, then try to put text after it
        txtIdx = 1;//from   w ww .  j a va2 s.  co  m
        txtSpan = DOM.getChild(this.getElement(), txtIdx);
    }

    if (txtSpan == null) {
        txtSpan = DOM.createSpan();
        DOM.setInnerHTML(txtSpan, text);
    }
    DOM.insertChild(this.getElement(), txtSpan, txtIdx);
}

From source file:com.google.code.p.gwtchismes.client.GWTCHelper.java

License:Apache License

/**
 * Loads a css resource including it in the head block
 * @param url/*from  w w w.j  a va  2  s  . c  om*/
 *     full path of the css resource
 */
public static void insertCSS(String url) {
    if (DOM.getElementById(url) != null)
        return;
    Element head = null;
    Element body = RootPanel.getBodyElement();
    Element doc = DOM.getParent(body);
    for (int i = 0; i < DOM.getChildCount(doc); i++) {
        Element child = DOM.getChild(doc, i);
        if (child.toString().toLowerCase().contains("head")) {
            head = child;
            break;
        }
    }
    if (head == null) {
        head = DOM.createElement("head");
        DOM.appendChild(doc, head);
    }
    Element css = DOM.createElement("link");
    DOM.setElementAttribute(css, "rel", "stylesheet");
    DOM.setElementAttribute(css, "type", "text/css");
    DOM.setElementAttribute(css, "href", url);
    DOM.setElementAttribute(css, "id", url);
    DOM.appendChild(head, css);
}