Java 类com.google.gwt.dom.client.HeadElement 实例源码

项目:gwt-chronoscope    文件:GoogleLoader.java   
public static void load(Chronoscope.URLResolver resolver, final String libName,
      final String version, final Command callback) {
    if (!injectedLoader) {
      final ScriptElement se = Document.get().createScriptElement();
//      se.setSrc(intrinsics.getCachedUrl("http://www.google.com/jsapi?callback=" + JSAPI_CALLBACK));
      se.setSrc("http://www.google.com/jsapi?callback=" + JSAPI_CALLBACK);

      final HeadElement he = HeadElement.as(Document.get().getElementsByTagName("head").getItem(0));
      exportHandler(new Command() {

        public void execute() {
          injectedLoader=true;
          he.removeChild(se);
          nativeLoad(libName, version, callback);
        }
      });

      he.appendChild(se);
    } else {
      nativeLoad(libName, version, callback);
    }
  }
项目:hawkbit    文件:ViewClientCriterion.java   
/**
 * Styles a multi-row selection with the number of elements.
 *
 * @param drag
 *            the current drag event holding the context.
 */
void setMultiRowDragDecoration(VDragEvent drag) {
    Widget widget = drag.getTransferable().getDragSource().getWidget();

    if (widget instanceof VScrollTable) {
        VScrollTable table = (VScrollTable) widget;
        int rowCount = table.selectedRowKeys.size();

        Element dragCountElement = Document.get().getElementById(SP_DRAG_COUNT);
        if (rowCount > 1 && table.selectedRowKeys.contains(table.focusedRow.getKey())) {
            if (dragCountElement == null) {
                dragCountElement = Document.get().createStyleElement();
                dragCountElement.setId(SP_DRAG_COUNT);
                HeadElement head = HeadElement.as(Document.get().getElementsByTagName(HeadElement.TAG).getItem(0));
                head.appendChild(dragCountElement);
            }
            SafeHtml formattedCssStyle = getDraggableTemplate().multiSelectionStyle(determineActiveTheme(drag),
                    String.valueOf(rowCount));
            StyleElement dragCountStyleElement = StyleElement.as(dragCountElement);
            dragCountStyleElement.setInnerSafeHtml(formattedCssStyle);
        } else if (dragCountElement != null) {
            dragCountElement.removeFromParent();
        }
    }
}
项目:gwt-promptly    文件:Init.java   
public void onModuleLoad() {
    final String linkTxt = Resources.INSTANCE.linkTxt().getText();
    final Document document = Document.get();
    HeadElement headElement = document.getHead();
    if (headElement == null) {
        headElement = document.createHeadElement();
        document.appendChild(headElement);
    }
    LinkElement linkElement = document.createLinkElement();
    linkElement.setType("text/css");
    linkElement.setRel("stylesheet");
    linkElement.setHref(linkTxt);
    headElement.appendChild(linkElement);
}
项目:tristar-eye    文件:LinkElementInjector.java   
private HeadElement getHead() {
    if(this.head == null) {
        Element element = Document.get().getElementsByTagName(HEAD_TAG_NAME).getItem(0);
        assert element != null : ERROR_HEAD_NOT_FOUND;
        this.head = HeadElement.as(element);
    }
    return this.head;
}
项目:ahome-touch    文件:CSS.java   
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);
    }
    return head;
}
项目:ahome-touch    文件:JsInjector.java   
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;
    }
    return head;
}
项目:putnami-web-toolkit    文件:DefaultThemeController.java   
/**
 * Gets the head tag element.
 *
 * @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;
}
项目:ahome-core    文件:CSSUtil.java   
public static void injectStyleSheet(String href, String id) {
    HeadElement head = getHead();
    LinkElement element = createLinkElement();
    element.setHref(href);
    element.setId(id);
    head.appendChild(element);
}
项目:ahome-core    文件:CSSUtil.java   
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);
    }
    return head;
}
项目:cloud-dev-studio    文件:ESBJavaScriptInjector.java   
public static void inject(String javascript) {

        HeadElement head = getHead();
        new Timer() {

            public void run() {
                // goJsPlumb();
                goJS();
            }
        }.schedule(1);

        ScriptElement element = createScriptElement();
        element.setText(javascript);
        head.appendChild(element);
    }
项目:cloud-dev-studio    文件:ESBJavaScriptInjector.java   
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);
        ESBJavaScriptInjector.head = head;
    }
    return ESBJavaScriptInjector.head;
}
项目:cloud-dev-studio    文件:JSLibInjector.java   
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);
        JSLibInjector.head = head;
    }
    return JSLibInjector.head;
}
项目:QMAClone    文件:PlusOne.java   
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);
        PlusOne.head = head;
    }
    return PlusOne.head;
}
项目:touch4j    文件:JsInjector.java   
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;
    }
    return head;
}
项目:ahome-touch    文件:JsInjector.java   
public static void intject(String javaScript) {
    HeadElement head = getHead();
    ScriptElement element = createScriptElement();
    element.setText(javaScript);
    head.appendChild(element);
}
项目:cloud-dev-studio    文件:JSLibInjector.java   
public static void inject(String javascript) {
    HeadElement head = getHead();
    ScriptElement element = createScriptElement();
    element.setText(javascript);
    head.appendChild(element);
}
项目:touch4j    文件:JsInjector.java   
public static void intject(String javaScript) {
    HeadElement head = getHead();
    ScriptElement element = createScriptElement();
    element.setText(javaScript);
    head.appendChild(element);
}
项目:ahome-touch    文件:CSS.java   
/**
 * Injects the css url code into a
 * {@code <link rel="stylesheet" href="...." />} element in the document
 * header.
 * 
 * @param javascript
 *            the JavaScript code
 */
public static void injectStyleSheet(String href) {
    HeadElement head = getHead();
    LinkElement element = createLinkElement();
    element.setHref(href);
    head.appendChild(element);
}
项目:ahome-core    文件:CSSUtil.java   
/**
 * Injects the css url code into a
 * {@code <link rel="stylesheet" href="...." />} element in the document
 * header.
 * 
 * @param javascript
 *            the JavaScript code
 */
public static void injectStyleSheet(String href) {
    HeadElement head = getHead();
    LinkElement element = createLinkElement();
    element.setHref(href);
    head.appendChild(element);
}
项目:Peergos    文件:Showcase.java   
/**
 * Convenience method for getting the document's head element.
 *
 * @return the document's head element
 */
private native HeadElement getHeadElement() /*-{
  return $doc.getElementsByTagName("head")[0];
}-*/;
项目:swarm    文件:Showcase.java   
/**
 * Convenience method for getting the document's head element.
 *
 * @return the document's head element
 */
private native HeadElement getHeadElement() /*-{
  return $doc.getElementsByTagName("head")[0];
}-*/;