Package com.google.gwt.dom.client

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


   public Rectangle getPreviewClientRect()
   {
      WindowEx win = imageFrame_.getElement().<IFrameElementEx>cast()
            .getContentWindow();
      Document doc = win.getDocument();
      NodeList<Element> images = doc.getElementsByTagName("img");
      if (images.getLength() > 0)
      {
         ElementEx img = images.getItem(0).cast();
         return new Rectangle(img.getClientLeft(),
                              img.getClientTop(),
View Full Code Here


    boolean alreadyLoaded = nativeCreateCallback();
    alreadyInjected = true;
    if (alreadyLoaded) {
      return true;
    }
    Document doc = Document.get();
    String key = (apiKey == null) ? "" : ("key=" + apiKey + "&");
    hostname = (hostname == null) ? "www.google.com" : hostname;
    String src = getProtocol() + "//" + hostname + "/jsapi?" + key
        + "callback=__gwt_AjaxLoader_onLoad";
    ScriptElement script = doc.createScriptElement();
    script.setSrc(src);
    script.setType("text/javascript");
    doc.getBody().appendChild(script);
    return false;
  }
View Full Code Here

    IFrameElement cajaFrame = Document.get().createIFrameElement();
    cajaFrame.setFrameBorder(0);
    cajaFrame.setAttribute("width", "0");
    cajaFrame.setAttribute("height", "0");
    Document.get().getBody().appendChild(cajaFrame);
    Document cajaFrameDoc = cajaFrame.getContentDocument();
    cajaFrameDoc.getBody().appendChild(
        cajaFrameDoc.createScriptElement(RESOURCES.supportingJs().getText()));
    cajaFrameDoc.getBody().appendChild(
        cajaFrameDoc.createScriptElement(RESOURCES.taming().getText()));
    return cajaFrame;
  }
View Full Code Here

    // Render HTML
    domitaVdocElement.setInnerHTML(response.getHtml());

    // Inject JS
    Document cajaFrameDoc = cajaFrame.getContentDocument();
    cajaFrameDoc.getBody().appendChild(cajaFrameDoc.createScriptElement(response.getJs()));
  }
View Full Code Here

   * @param content
   * @param window
   */
  public static void createViewport(String content, JavaScriptObject wnd)
  {
    Document document = getWindowDocument(wnd);
    MetaElement viewport = document.createMetaElement();
    viewport.setContent(content);
    viewport.setName("viewport");
    document.getElementsByTagName("head").getItem(0).appendChild(viewport);
    JavaScriptObject parentWindow = getParentWindow(wnd);
    if (parentWindow != null && isCruxWindow(parentWindow))
    {
      createViewport(content, parentWindow);
    }
View Full Code Here

    return parts && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host );
  }-*/;
 
  private static ScriptElement cloneScript(ScriptElement script)
  {
    Document doc = Document.get();
    ScriptElement cloneScript = doc.createScriptElement();
    cloneScript.setType("text/javascript");
    cloneScript.setLang("javascript");
    if (script.hasAttribute("src"))
    {
      cloneScript.setSrc(script.getSrc());
View Full Code Here

      }

      @Override
      protected void onFrameLoaded()
      {
         Document doc = getDocument();
         PreElement pre = doc.createPreElement();
         pre.setInnerText(code_);
         pre.getStyle().setProperty("whiteSpace", "pre-wrap");
         pre.getStyle().setFontSize(fontSize_, Unit.PT);
         doc.getBody().appendChild(pre);

         getWindow().print();

         // Bug 1224: ace: print from source causes inability to reconnect
         // This was caused by the iframe being removed from the document too
View Full Code Here

            ((Resources) GWT.create(Resources.class)).diff_match_patch().getText());
   }
  
   private static void injectJavascript(String source)
   {
      Document doc = Document.get();
      HeadElement head = (HeadElement) doc.getElementsByTagName("head").getItem(0);
      if (head == null)
      {
         head = doc.createHeadElement();
         doc.insertBefore(head, doc.getBody());
      }
      ScriptElement script = doc.createScriptElement(
            source);
      script.setType("text/javascript");
      head.appendChild(script);
   }
View Full Code Here

             !satellite.getWindow().isClosed())
         {
            // save the window's geometry so we can restore it after the window
            // is destroyed
            final WindowEx win = satellite.getWindow();
            Document doc = win.getDocument();
            preferredSize = new Size(doc.getClientWidth(), doc.getClientHeight());
            preferredPos = new Point(win.getLeft(), win.getTop());
            callNotifyPendingReactivate(win);

            // close the window
            try
View Full Code Here

              throw new XPathException("Error on evaluating (in static context) result-document href: " + hrefValue);
            }
            expr = visitor.typeCheck(expr, NodeKindTest.DOCUMENT);
            XPathContext c3 = context.newCleanContext();
            //context for ?select expression is the html page if an external node is the context
            Document page = (Document)controller.getTargetNode(); //com.google.gwt.dom.client.Document.get();
            Item cItem = context.getContextItem();
           
            NodeInfo currentContextItem;
            if (cItem instanceof JSObjectValue){
              currentContextItem = null;
            } else {
              currentContextItem = (NodeInfo)cItem;
            }
           
            boolean useCurrentContext;
            if (currentContextItem == null) {
              useCurrentContext = false;
            } else {
              useCurrentContext = (currentContextItem.getBaseURI().equals(page.getURL()));
            }
           
            NodeInfo contextItem;

            if (useCurrentContext) {
              contextItem = currentContextItem;
              if (LogConfiguration.loggingIsEnabled() && contextItem.getNodeKind() == Type.ELEMENT) {
                contextNodeName = controller.getNamePool().getLocalName(contextItem.getNameCode());
              }
            } else {
              contextItem = new HTMLDocumentWrapper(page, page.getURL(), context.getConfiguration(), DocType.UNKNOWN);
            }
            if (LogConfiguration.loggingIsEnabled()) {
              contextNodeName = (contextNodeName.equals("")? "" : " context node: " + contextNodeName);
            }
View Full Code Here

TOP

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

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.