List of usage examples for com.google.gwt.dom.client LinkElement getType
public String getType()
From source file:com.vaadin.client.ui.ui.UIConnector.java
License:Apache License
/** * Internal helper for removing any stylesheet with the given URL * // ww w .j a v a2s . co m * @since 7.3 * @param url * the url to match with existing stylesheets */ private void removeStylesheet(String url) { NodeList<Element> linkTags = getHead().getElementsByTagName(LinkElement.TAG); for (int i = 0; i < linkTags.getLength(); i++) { LinkElement link = LinkElement.as(linkTags.getItem(i)); if (!"stylesheet".equals(link.getRel())) { continue; } if (!"text/css".equals(link.getType())) { continue; } if (url.equals(link.getHref())) { getHead().removeChild(link); } } }
From source file:com.vaadin.client.ui.ui.UIConnector.java
License:Apache License
/** * Finds a link tag for a style sheet with the given URL * //from w w w . jav a 2s . c o m * @since 7.3 * @param url * the URL of the style sheet * @return the link tag or null if no matching link tag was found */ private LinkElement findStylesheetTag(String url) { NodeList<Element> linkTags = getHead().getElementsByTagName(LinkElement.TAG); for (int i = 0; i < linkTags.getLength(); i++) { final LinkElement link = LinkElement.as(linkTags.getItem(i)); if ("stylesheet".equals(link.getRel()) && "text/css".equals(link.getType()) && url.equals(link.getHref())) { return link; } } return null; }
From source file:edu.caltech.ipac.firefly.ui.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;/*from w ww. j ava2 s .c o m*/ String favIcon = le.getHref(); break; } } } }