Example usage for com.google.gwt.dom.client HeadElement as

List of usage examples for com.google.gwt.dom.client HeadElement as

Introduction

In this page you can find the example usage for com.google.gwt.dom.client HeadElement as.

Prototype

public static HeadElement as(Element elem) 

Source Link

Document

Assert that the given Element is compatible with this class and automatically typecast it.

Usage

From source file:burrito.client.crud.widgets.FormattedRichTextArea.java

License:Apache License

@Override
protected void onAttach() {
    super.onAttach();

    Timer cssTimer = new Timer() {
        @Override/*from  w  ww .j  a v  a  2s. co  m*/
        public void run() {
            Document doc = IFrameElement.as(getElement()).getContentDocument();
            StyleElement style = doc.createStyleElement();
            style.setInnerText(CSS);
            HeadElement.as(Element.as(doc.getBody().getPreviousSibling())).appendChild(style);
        }
    };

    cssTimer.schedule(100);
}

From source file:com.ait.ext4j.client.util.CSS.java

License:Apache License

private static HeadElement getHead() {
    if (head == null) {
        Element element = Document.get().getElementsByTagName("head").getItem(0);
        assert element != null : "HTML Head element required";
        head = HeadElement.as(element);
    }//  w w  w.j  a  va  2 s .  co  m
    return head;
}

From source file:com.ait.toolkit.sencha.touch.client.core.JsInjector.java

License:Open Source License

private static HeadElement getHead() {
    if (head == null) {
        Element element = Document.get().getElementsByTagName("head").getItem(0);
        assert element != null : "HTML Head element required";
        HeadElement headElement = HeadElement.as(element);
        head = headElement;//from   w ww.  j a  v a 2  s. c om
    }
    return head;
}

From source file:com.github.gwtbootstrap.client.ui.resources.AbstractInjector.java

License:Apache License

/**
 * Gets the document header./*from ww w. jav  a2s  .  co  m*/
 * 
 * @return the document header
 */
protected static HeadElement getHead() {
    if (head == null) {
        Element element = Document.get().getElementsByTagName("head").getItem(0);
        assert element != null : "HTML Head element required";
        HeadElement head = HeadElement.as(element);
        AbstractInjector.head = head;
    }
    return AbstractInjector.head;
}

From source file:com.github.gwtbootstrap.client.ui.resources.ResourceInjector.java

License:Apache License

private static HeadElement getHead() {
    if (head == null) {
        Element elt = Document.get().getElementsByTagName("head").getItem(0);
        assert elt != null : "The host HTML page does not have a <head> element"
                + " which is required by StyleInjector";
        head = HeadElement.as(elt);
    }//from   ww  w. ja  v a2  s  .  com
    return head;
}

From source file:com.googlecode.gflot.client.util.JavaScriptInjector.java

License:Open Source License

private static HeadElement getHead() {
    if (head == null) {
        Element element = Document.get().getElementsByTagName("head").getItem(0);
        assert element != null : "HTML Head element required";
        HeadElement head = HeadElement.as(element);
        JavaScriptInjector.head = head;// w  w w  . java  2 s.c  o m
    }
    return JavaScriptInjector.head;
}

From source file:com.pronoiahealth.olhie.resources.OlhieResourceInjector.java

License:Open Source License

/**
 * Get page head element//from   w  w  w . j  av a 2  s.  com
 * 
 * @return
 */
private static HeadElement getHead() {
    if (head == null) {
        Element elt = Document.get().getElementsByTagName("head").getItem(0);
        assert elt != null : "The host HTML page does not have a <head> element"
                + " which is required by StyleInjector";
        head = HeadElement.as(elt);
    }
    return head;
}

From source file:com.rhizospherejs.gwt.client.resources.DOMHelper.java

License:Open Source License

/**
 * Returns the HEAD section of the GWT host page.
 *//*from  ww  w.j a v  a  2s . c om*/
private HeadElement getHead() {
    if (head == null) {
        Element elt = Document.get().getElementsByTagName("head").getItem(0);
        assert elt != null : "The host HTML page does not have a <head> element"
                + " which is required by StyleInjector";
        head = HeadElement.as(elt);
    }
    return head;
}

From source file:com.vaadin.client.ui.ui.UIConnector.java

License:Apache License

/**
 * Internal helper to get the <head> tag of the page
 * /*w w  w . j a v  a  2 s  .co m*/
 * @since 7.3
 * @return the head element
 */
private HeadElement getHead() {
    return HeadElement.as(Document.get().getElementsByTagName(HeadElement.TAG).getItem(0));
}

From source file:fr.putnami.pwt.core.theme.client.DefaultThemeController.java

License:Open Source License

/**
 * Gets the head tag element./*from  ww  w  . jav a  2 s  .c  o m*/
 *
 * @return the head tag element
 */
protected HeadElement getHead() {
    if (this.head == null) {
        Element elt = Document.get().getElementsByTagName("head").getItem(0);
        assert elt != null : "The host HTML page does not have a <head> element"
                + " which is required by this injector";
        this.head = HeadElement.as(elt);
    }
    return this.head;
}