List of usage examples for com.google.gwt.dom.client LocalDom flush
public static void flush()
From source file:cc.alcina.framework.gwt.client.util.ClientUtils.java
License:Apache License
public static Element updateCss(Element styleElement, String css) { if (styleElement == null) { styleElement = Document.get().createStyleElement(); NodeList<Element> headList = Document.get().getElementsByTagName(HEAD); if (headList == null || headList.getLength() == 0) { // something wrong with the client here -- bail AlcinaTopics/*from w w w. j av a2 s . c o m*/ .notifyDevWarning(new Exception("headList - " + headList == null ? "null" : "length 0")); return null; } headList.getItem(0).appendChild(styleElement); LocalDom.flush(); } if (css.length() != 0) { try { if (!setCssTextViaCssTextProperty(styleElement, css)) { styleElement.setInnerText(css); } } catch (Exception e) { // squelch } } return styleElement; }