Package com.google.gwt.dom.client

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


  public void reSymbolize(final String sourceServer,
      final SourceViewerServer sourceViewerServer, final JsSymbol sourceSymbol,
      final SourcePresenter sourcePresenter) {
    assert (myElem != null) : "Element is null when attempting resymbolization in StackFrameRenderer";

    Document document = myElem.getOwnerDocument();
    AnchorElement symbolLink = document.createAnchorElement();

    symbolLink.setInnerText(sourceSymbol.getSymbolName());
    symbolLink.setHref("javascript:;");
    symbolLink.setClassName(stackTraceRenderer.getResources().stackFrameRendererCss().resymbolizedSymbol());
    myElem.appendChild(symbolLink);
    myElem.appendChild(document.createBRElement());
    stackTraceRenderer.getListenerManager().manageEventListener(
        ClickEvent.addClickListener(symbolLink, symbolLink,
            new ClickListener() {
              public void onClick(ClickEvent event) {
                sourcePresenter.showSource(sourceServer
View Full Code Here


      initializationState = FBInitialization.InitializationState.Initialized;
      fireInitSuccess();
      return;
    }

    Document doc = Document.get();
    Element fbRootElement = doc.getElementById(FacebookRootElementID);
    if (fbRootElement == null) {
      fbRootElement = DOM.createDiv();
      fbRootElement.setId(FacebookRootElementID);
      BodyElement bodyElement = doc.getBody();
      bodyElement.appendChild(fbRootElement);
    }

    String fbLocale = locale;
    if (fbLocale == null) {
      // todo: get default locale from user, accounting for list of Facebook-allowed locales, available from http://www.facebook.com/translations/FacebookLocales.xml
      fbLocale = DefaultLocale;
    }

    ScriptElement script = doc.createScriptElement();
    script.setType("text/javascript");
    script.setId(FacebookScriptElementID);
    script.setSrc(Window.Location.getProtocol() + "//" + FacebookScriptServer + "/" + fbLocale + "/" + FacebookScriptName);
    // facebook seems to think this async is necessary
    script.setPropertyBoolean("async", true);
View Full Code Here

    fbRootElement.appendChild(script);
  }

  private boolean hasFacebookScriptElement() {
    Document doc = Document.get();
    if (doc.getElementById(FacebookScriptElementID) != null) {
      return true;
    }

    // enhance: check other script elements for facebook API access (?)
View Full Code Here

    // The following is a very simple example, which constructs a layout around
    // a parent element, and attaches two child elements that split their
    // parent's space vertically. It then goes on to animate from the first
    // state to a horizontal stacking that uses EM units rather than
    // percentages.
    Document doc = Document.get();
    Element parent = doc.createDivElement();
    doc.getBody().appendChild(parent);

    Layout layout = new Layout(parent);
    layout.onAttach();

    Element topChild = doc.createDivElement(), bottomChild = doc
        .createDivElement();
    Layer topLayer = layout.attachChild(topChild);
    Layer bottomLayer = layout.attachChild(bottomChild);

    // Stack the two children vertically, meeting at 50%.
View Full Code Here

  @DoNotRunWith(Platform.HtmlUnitLayout)
  public void testFillParent() {
    // We don't use the default elements created in gwtSetUp() because we need
    // to test the behavior when the layout is contained by an element other
    // than the <body>.
    Document doc = Document.get();
    DivElement container = doc.createDivElement();
    DivElement parent = doc.createDivElement();
    DivElement child = doc.createDivElement();
    child.setInnerHTML("&nbsp;");
    doc.getBody().appendChild(container);
    container.appendChild(parent);

    // The container has to be position:relative so that it serves as an offset
    // parent.
    container.getStyle().setPosition(Position.RELATIVE);
View Full Code Here

    // ensure enough sizes for this test
    ResizeHelper.resizeTo(800, 600);

    Window.enableScrolling(false);

    Document doc = Document.get();
    parent = doc.createDivElement();
    child0 = doc.createDivElement();
    child1 = doc.createDivElement();
    doc.getBody().appendChild(parent);

    layout = new Layout(parent);
    layout.onAttach();
    layout.fillParent();
View Full Code Here

           
            if (frame.getIFrame().getContentDocument() == null)
               return true;

            // wait for the document to finish loading
            Document doc = frame.getIFrame().getContentDocument();
            String readyState = getDocumentReadyState(doc);
            if (readyState == null)
               return true;
           
            if (!readyState.equals("complete"))
               return true;
           
            // wait for a real document to load (about:blank may be intermediate)
            if (doc.getScrollTop() > 0)
               return true;

            if (doc.getURL().equals(ViewerPane.ABOUT_BLANK))
               return true;
           
            // restore scroll position
            if (scrollPosition > 0)
               doc.setScrollTop(scrollPosition);

            return false;
         }
        
         private int retries_ = 0;
View Full Code Here

      el.focus() ;
      if (alwaysDriveSelection
            || (el.getContentEditable() &&
                (el.getInnerText() == null || el.getInnerText() == "")))
      {
         Document doc = el.getOwnerDocument();
         Range range = Range.create(doc) ;
         range.selectNodeContents(el) ;
         Selection sel = Selection.get(NativeWindow.get(doc)) ;
         sel.setRange(range);
      }
View Full Code Here

   public void setSelectionOffsets(Element container, int start, int end)
   {
      NodeRelativePosition startp = NodeRelativePosition.toPosition(container, start);
      NodeRelativePosition endp = NodeRelativePosition.toPosition(container, end);

      Document doc = container.getOwnerDocument();
      Range rng = Range.create(doc) ;
      rng.setStart(startp.node, startp.offset) ;
      rng.setEnd(endp.node, endp.offset) ;
      Selection.get(NativeWindow.get(doc)).setRange(rng) ;
View Full Code Here

   }

   @Override
   public void selectElement(Element el)
   {
      Document doc = el.getOwnerDocument();
      Range rng = Range.create(doc);
      rng.selectNode(el);
      Selection.get(NativeWindow.get(doc)).setRange(rng);
   }
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.