public StyleElement injectStyleSheet(String contents) { StyleElement style = createElement(contents); getHead().appendChild(style); return style; }
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; } }
public StyleElement injectStyleSheetAtStart(String contents) { StyleElement style = createElement(contents); getHead().insertBefore(style, head.getFirstChild()); return style; }
/** * Styles a multi-row selection with the number of elements. * * @param drag * the current drag event holding the context. */ void setMultiRowDragDecoration(final VDragEvent drag) { final Widget widget = drag.getTransferable().getDragSource().getWidget(); if (widget instanceof VScrollTable) { final VScrollTable table = (VScrollTable) widget; final 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); final HeadElement head = HeadElement .as(Document.get().getElementsByTagName(HeadElement.TAG).getItem(0)); head.appendChild(dragCountElement); } final SafeHtml formattedCssStyle = getDraggableTemplate() .multiSelectionStyle(determineActiveTheme(drag), String.valueOf(rowCount)); final StyleElement dragCountStyleElement = StyleElement.as(dragCountElement); dragCountStyleElement.setInnerSafeHtml(formattedCssStyle); } else if (dragCountElement != null) { dragCountElement.removeFromParent(); } } }
assert name != null : "the name must not be null"; NodeList<Element> tags = head.getElementsByTagName("meta"); MetaElement metaTag = null; for (int i = 0; i < tags.getLength(); i++) { metaTag = doc.createMetaElement(); metaTag.setName(name); head.appendChild(metaTag);
/** * Assert that the given {@link Element} is compatible with this class and * automatically typecast it. */ public static HeadElement as(Element elem) { assert is(elem); return (HeadElement) elem; }
/** * Styles a multi-row selection with the number of elements. * * @param drag * the current drag event holding the context. */ void setMultiRowDragDecoration(final VDragEvent drag) { final Widget widget = drag.getTransferable().getDragSource().getWidget(); if (widget instanceof VScrollTable) { final VScrollTable table = (VScrollTable) widget; final 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); final HeadElement head = HeadElement .as(Document.get().getElementsByTagName(HeadElement.TAG).getItem(0)); head.appendChild(dragCountElement); } final SafeHtml formattedCssStyle = getDraggableTemplate() .multiSelectionStyle(determineActiveTheme(drag), String.valueOf(rowCount)); final StyleElement dragCountStyleElement = StyleElement.as(dragCountElement); dragCountStyleElement.setInnerSafeHtml(formattedCssStyle); } else if (dragCountElement != null) { dragCountElement.removeFromParent(); } } }
assert name != null : "the name must not be null"; NodeList<Element> tags = head.getElementsByTagName("meta"); MetaElement metaTag = null; for (int i = 0; i < tags.getLength(); i++) { metaTag = doc.createMetaElement(); metaTag.setName(name); head.appendChild(metaTag);
/** * Determines whether the given {@link JavaScriptObject} can be cast to * this class. A <code>null</code> object will cause this method to * return <code>false</code>. */ public static boolean is(JavaScriptObject o) { if (Element.is(o)) { return is((Element) o); } return false; }
public StyleElement injectStyleSheet(String contents) { StyleElement style = createElement(contents); getHead().appendChild(style); return style; }
private static HeadElement getHead() { Element elt = Document.get().getElementsByTagName("head").getItem(0); if (elt == null) { throw new RuntimeException("The host HTML page does not have a <head> element" + " which is required by StyleInjector"); } return HeadElement.as(elt); }
public StyleElement injectStyleSheetAtStart(String contents) { StyleElement style = createElement(contents); getHead().insertBefore(style, head.getFirstChild()); return style; }
/** * Determine whether the given {@link Node} can be cast to this class. * A <code>null</code> node will cause this method to return * <code>false</code>. */ public static boolean is(Node node) { if (Element.is(node)) { return is((Element) node); } return false; }
public StyleElement injectStyleSheet(String contents) { StyleElement style = createElement(contents); getHead().appendChild(style); return style; }
private static HeadElement getHead() { Element elt = Document.get().getElementsByTagName("head").getItem(0); if (elt == null) { throw new RuntimeException("The host HTML page does not have a <head> element" + " which is required by StyleInjector"); } return HeadElement.as(elt); }
public StyleElement injectStyleSheetAtStart(String contents) { StyleElement style = createElement(contents); getHead().insertBefore(style, head.getFirstChild()); return style; }
/** * Assert that the given {@link Element} is compatible with this class and * automatically typecast it. */ public static HeadElement as(Element elem) { assert is(elem); return (HeadElement) elem; }
public StyleElement injectStyleSheet(String contents) { StyleElement style = createElement(contents); getHead().appendChild(style); return style; }
private static HeadElement getHead() { Element elt = Document.get().getElementsByTagName("head").getItem(0); if (elt == null) { throw new RuntimeException("The host HTML page does not have a <head> element" + " which is required by StyleInjector"); } return HeadElement.as(elt); }
public StyleElement injectStyleSheetAtStart(String contents) { StyleElement style = createElement(contents); getHead().insertBefore(style, head.getFirstChild()); return style; }