Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.StyleElement


  /**
   * The DOM-compatible way of adding stylesheets.
   */
  static class StyleInjectorImpl {
    void injectStyleSheet(String contents) {
      StyleElement style = Document.get().createStyleElement();
      style.setPropertyString("language", "text/css");
      style.setInnerText(contents);
      Document.get().getElementsByTagName("head").getItem(0).appendChild(style);
    }
View Full Code Here


        // the theme tag in IE8-IE10 (we don't want to wipe them out if we
        // change theme).
        // StyleInjectorImplIE always injects to the last style tag on the page.
        if (BrowserInfo.get().isIE()
                && BrowserInfo.get().getBrowserMajorVersion() < 11) {
            StyleElement style = Document.get().createStyleElement();
            style.setType("text/css");
            getHead().appendChild(style);
        }

        DOM.sinkEvents(getWidget().getElement(), Event.ONKEYDOWN
                | Event.ONSCROLL);
View Full Code Here

         return intrinsics.getCachedUrl(s);
      }
    });
   
    final HeadElement he = HeadElement.as(Document.get().getElementsByTagName("head").getItem(0));
    StyleElement se = Document.get().createStyleElement();
    se.setAttribute("href", "Chronoscope.css");
    se.setAttribute("src", "Chronoscope.css");
    he.appendChild(se);
   
    GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
      public void onUncaughtException(Throwable e) {
        RootPanel.get()
View Full Code Here

   */
  public static class StyleInjectorImpl {
    private static final StyleInjectorImpl IMPL = GWT.create(StyleInjectorImpl.class);

    public StyleElement injectStyleSheet(String contents) {
      StyleElement style = Document.get().createStyleElement();
      style.setPropertyString("language", "text/css");
      setContents(style, contents);
      Document.get().getElementsByTagName("head").getItem(0).appendChild(style);
      return style;
    }
View Full Code Here

   * IE doesn't allow manipulation of a style element through DOM methods.
   */
  public static class StyleInjectorImplIE extends StyleInjectorImpl {
    @Override
    public StyleElement injectStyleSheet(String contents) {
      StyleElement style = createElement();
      setContents(style, contents);
      return style;
    }
View Full Code Here

  }-*/;

  private static void injectStyles(IFrameElement sourceFrame, String styleText) {
    Document iframeDocument = sourceFrame.getContentDocument();
    HeadElement head = iframeDocument.getElementsByTagName("head").getItem(0).cast();
    StyleElement styleTag = iframeDocument.createStyleElement();
    styleTag.setInnerText(styleText);
    head.appendChild(styleTag);
  }
View Full Code Here

      styles.ensureInjected();
   }

   public static void injectStylesIntoDocument(Document doc)
   {
      StyleElement style = doc.createStyleElement();
      style.setType("text/css");
      style.setInnerText(styles.getText());
      doc.getBody().appendChild(style);
   }
View Full Code Here

      final String STYLE_EL_ID = "__rstudio_normal_size";

      Element oldStyle = document.getElementById(STYLE_EL_ID);

      StyleElement style = document.createStyleElement();
      style.setAttribute("type", "text/css");
      style.setInnerText("." + styles.normalSize() + ", " +
                         "." + styles.normalSize() + " td, " +
                         "." + styles.normalSize() + " pre" +
                         " {font-size:" + size + "pt !important;}");
      document.getBody().appendChild(style);

      if (oldStyle != null)
         oldStyle.removeFromParent();

      style.setId(STYLE_EL_ID);
   }
View Full Code Here

    this.interval = interval;
  }

  public void watchStyleSheet(String url) {
    if (!styleSheetsByUrl.containsKey(url)) {
      StyleElement styleElement = Document.get().createStyleElement();
      getHead().appendChild(styleElement);
      styleSheetsByUrl.put(url, styleElement);
      cssContentByUrl.put(url, "");
      maybeStartWatcher();
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.StyleElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.