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

项目:gwt-ol3    文件:DemoUtils.java   
/**
 * Create a MapBox logo.
 *
 * @return MapBox logo
 */
public static Control createMapboxLogo() {

    ControlOptions controlOptions = new ControlOptions();

    LinkElement mapboxLogo = Document.get().createLinkElement();
    mapboxLogo.setHref("https://mapbox.com/about/maps");
    mapboxLogo.setTarget("_blank");

    mapboxLogo.getStyle().setPosition(Position.ABSOLUTE);
    mapboxLogo.getStyle().setLeft(2, Unit.PX);
    mapboxLogo.getStyle().setBottom(5, Unit.PX);
    mapboxLogo.getStyle().setWidth(126, Unit.PX);
    mapboxLogo.getStyle().setHeight(40, Unit.PX);
    mapboxLogo.getStyle().setDisplay(Display.BLOCK);
    mapboxLogo.getStyle().setOverflow(Overflow.HIDDEN);

    mapboxLogo.getStyle().setBackgroundImage("url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIIAAAAoCAMAAAAFWtJHAAAAwFBMVEUAAAAAAAAAAABtbW0AAAAAAAAAAAAAAAAAAAAAAAClpaUAAADp6ekAAAD5+fna2toAAAAMDAzv7+/Nzc0AAAA2Njb8/Pz9/f3T09MAAAAAAAD7+/sAAAArKyuxsbH39/fs7OwbGxuIiIjz8/N8fHyenp7u7u74+PgAAAC8vLxWVlbx8fF1dXXl5eVcXFyUlJTQ0NDFxcVCQkLAwMC4uLj19fXo6OjW1tarq6ve3t77+/vi4uL6+vrKysrNzc3///8w7gSSAAAAP3RSTlMAOQNdPSYBPywKexLLGPCxNEHXnzFL+v2nGwf1IEiE6dBFad9jd9PuLo1V2mDDV3Cjl06SiuXIq4C3973ym6BQMVUPAAAEXElEQVR4Ae2WCVP6OBiH05L0l1IqrVbkKHJ54I0oHn+PfP9vtUle0z/YdhbH2XVnd58ZnRJIeHiPJOx//mH4vQSAN+8FjAhFxgHIaPvJeZ99hxwEElon5iAQbj85Y98g8ODwjEOMAvGFyeE3FEKgodTBqj0BJGN9DhyNd5Ta3ean9QEopfaA+LsKhnEKRExq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PqyHKxcfd14h21KhuLKUFU4f3osrC7F6uV3WXFnadL7wyAPeKDXw2RoJCO5GY4DouYvb/gepVXheLoewzPseQG9N/vzilrMIjoStE3++zvle4eSurw7XEe76ynI4aq+v7lEyt1x5awiFlFLQbHKIpabnM3eJLym4Szzzc/du7SU+zOXv9UNpECH7IoH/gecURPlN9vdQpeD47yhIFNX0U0QgvID9nENm+yxk/xb+AGAjNfRZuk9qAAAAAElFTkSuQmCC)");

    controlOptions.setElement(mapboxLogo);

    return new Control(controlOptions);
}
项目:putnami-web-toolkit    文件:DefaultThemeController.java   
/**
 * Removes all link tags in the head if not initialized.
 */
private void removeCssLinks() {
    if (this.isInit) {
        return;
    }
    this.isInit = true;
    // Remove all existing link element
    NodeList<Element> links = this.getHead().getElementsByTagName(LinkElement.TAG);
    int size = links.getLength();
    for (int i = 0; i < size; i++) {
        LinkElement elem = LinkElement.as(links.getItem(0));
        if ("stylesheet".equals(elem.getRel())) {
            elem.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 LinkElement createElement(String filePath) {
    LinkElement style = Document.get().createLinkElement();
    style.setType(CSS_MIME_TYPE);
    style.setRel(CSS);
    style.setHref(filePath);
    return style;
}
项目:scheduling-portal    文件:JSUtil.java   
public static void addStyle(String path) {
    Element head = Document.get().getElementsByTagName("head").getItem(0);
    LinkElement style = Document.get().createLinkElement();
    style.setPropertyString("language", "text/css");
    style.setRel("stylesheet");
    style.setHref(path);
    head.appendChild(style);
}
项目:che    文件:EditorInitializePromiseHolder.java   
private void injectCssLink(final String url) {
  // Avoid injecting built-codeEdit.css more than once as it may override
  // orion-codenvy-theme.css
  if (!cssLinkInjected) {
    final LinkElement link = Document.get().createLinkElement();
    link.setRel("stylesheet");
    link.setHref(url);
    Document.get().getHead().appendChild(link);
    cssLinkInjected = true;
  }
}
项目:che    文件:FontAwesomeInjector.java   
public FontAwesomeInjector() {
  LinkElement link = Document.get().createLinkElement();
  link.setRel("stylesheet");
  link.setHref(GWT.getModuleBaseForStaticFiles() + "font-awesome-4.5.0/css/font-awesome.min.css");

  Document.get().getHead().appendChild(link);
}
项目:firefly    文件:TitleFlasher.java   
private static void findFavIcon() {
    Document doc= Document.get();
    NodeList<Element> eleList=doc.getElementsByTagName("link");
    for (int i= 0; (i<eleList.getLength()); i++) {
        Element e= eleList.getItem(i);
        LinkElement le= LinkElement.as(e);
        if ("image/x-icon".equals(le.getType())) {
            if (!StringUtils.isEmpty(le.getHref())) {
                favIconElement= le;
                String favIcon= le.getHref();
                break;
            }
        }
    }
}
项目:ahome-touch    文件:CSS.java   
private static LinkElement createLinkElement() {
    LinkElement link = Document.get().createLinkElement();
    link.setRel("stylesheet");
    link.setType("text/css");
    return link;

}
项目: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);
}
项目:Peergos    文件:Showcase.java   
/**
 * Inject the GWT theme style sheet based on the RTL direction of the current
 * locale.
 */
private void injectThemeStyleSheet() {
  // Choose the name style sheet based on the locale.
  String styleSheet = "gwt/" + THEME + "/" + THEME;
  styleSheet += LocaleInfo.getCurrentLocale().isRTL() ? "_rtl.css" : ".css";

  // Load the GWT theme style sheet
  String modulePath = GWT.getModuleBaseURL();
  LinkElement linkElem = Document.get().createLinkElement();
  linkElem.setRel("stylesheet");
  linkElem.setType("text/css");
  linkElem.setHref(modulePath + styleSheet);
  getHeadElement().appendChild(linkElem);
}
项目:swarm    文件:Showcase.java   
/**
 * Inject the GWT theme style sheet based on the RTL direction of the current
 * locale.
 */
private void injectThemeStyleSheet() {
  // Choose the name style sheet based on the locale.
  String styleSheet = "gwt/" + THEME + "/" + THEME;
  styleSheet += LocaleInfo.getCurrentLocale().isRTL() ? "_rtl.css" : ".css";

  // Load the GWT theme style sheet
  String modulePath = GWT.getModuleBaseURL();
  LinkElement linkElem = Document.get().createLinkElement();
  linkElem.setRel("stylesheet");
  linkElem.setType("text/css");
  linkElem.setHref(modulePath + styleSheet);
  getHeadElement().appendChild(linkElem);
}
项目:tristar-eye    文件:LinkElementInjector.java   
public void injectStyleSheet(String fileWebPath) {
    LinkElement link = this.createElement(fileWebPath + QUERY_STRING_SEPARATOR + settings.getAppVersion());
    this.getHead().appendChild(link);
}
项目:ahome-core    文件:CSSUtil.java   
private static LinkElement createLinkElement() {
    LinkElement link = Document.get().createLinkElement();
    link.setRel("stylesheet");
    link.setType("text/css");
    return link;
}
项目: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);
}
项目:putnami-web-toolkit    文件:CssLink.java   
/**
 * Gets the link element of the css.
 *
 * @return the link element of the css
 */
public LinkElement getLink() {
    return this.link;
}