Package com.google.gwt.dom.client

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


    /**
     * Does some very small adjustments to body element. We need this just to
     * overcome some IE bugs.
     */
    public static void shakeBodyElement() {
        final DivElement shaker = Document.get().createDivElement();
        RootPanel.getBodyElement().insertBefore(shaker,
                RootPanel.getBodyElement().getFirstChildElement());
        shaker.getStyle().setPropertyPx("height", 0);
        shaker.setInnerHTML(" ");
        RootPanel.getBodyElement().removeChild(shaker);

    }
View Full Code Here


   }

   private Command showProgress()
   {
      String progressUrl = ProgressImages.createLargeGray().getUrl();
      final DivElement div = Document.get().createDivElement();
      StringBuilder str = new StringBuilder();
      str.append("<img src=\"");
      str.append(progressUrl);
      str.append("\"");
      if (BrowseCap.isRetina())
         str.append("width=24 height=24");
      str.append("/>");
      div.setInnerHTML(str.toString());
      div.getStyle().setWidth(100, Style.Unit.PCT);
      div.getStyle().setMarginTop(200, Style.Unit.PX);
      div.getStyle().setProperty("textAlign", "center");
      div.getStyle().setZIndex(1000);
      ElementIds.assignElementId(div, ElementIds.LOADING_SPINNER);
      Document.get().getBody().appendChild(div);

      return new Command()
      {
View Full Code Here

               return retries.getValue() < 40;
            }

            if (pdfLocation.isFromClick())
            {
               final DivElement div = win.getDocument().createDivElement();
               div.getStyle().setPosition(Style.Position.ABSOLUTE);
               div.getStyle().setTop(y, Unit.PX);
               div.getStyle().setLeft(x, Unit.PX);
               div.getStyle().setWidth(w, Unit.PX);
               div.getStyle().setHeight(h, Unit.PX);
               div.getStyle().setBackgroundColor("rgba(0, 126, 246, 0.1)");
               div.getStyle().setProperty("transition", "opacity 4s");
               // use DomUtils to set transition styles so gwt doesn't assert
               // an invalid style name (no camelCase) in debug mode
               DomUtils.setStyle(div, "-moz-transition", "opacity 4s");
               DomUtils.setStyle(div, "-webkit-transition", "opacity 4s");

               pageContainer.appendChild(div);

               Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand()
               {
                  @Override
                  public boolean execute()
                  {
                     div.getStyle().setOpacity(0.0);
                     return false;
                  }
               }, 2000);
            }
View Full Code Here

      initWidget(panel_);
   }

   private void addBgPanel(String className)
   {
      DivElement div = Document.get().createDivElement();
      div.setClassName(className);
      panel_.getElement().appendChild(div);
   }
View Full Code Here

      initWidget(layout_);
   }

   private DivElement addPanel(String styleName, int halign, int valign)
   {
      DivElement div = Document.get().createDivElement();
      div.setClassName(styleName);

      Style style = div.getStyle();
      style.setPosition(Style.Position.ABSOLUTE);

      switch (halign)
      {
         case LEFT:
View Full Code Here

  /**
   * Tests that it is possible to make a subclass of Image that can be wrapped.
   */
  public void testWrapOfSubclass() {
    String uid = Document.get().createUniqueId();
    DivElement div = Document.get().createDivElement();
    div.setInnerHTML("<img id='" + uid + "' src='counting-forward.png'>");
    Document.get().getBody().appendChild(div);

    final TestImage image = TestImage.wrap(Document.get().getElementById(uid));
    assertNotNull(image);

View Full Code Here

   * Tests that wrapping an existing DOM element works if you call
   * setUrlAndVisibleRect() on it.
   */
  public void testWrapThenSetUrlAndVisibleRect() {
    String uid = Document.get().createUniqueId();
    DivElement div = Document.get().createDivElement();
    div.setInnerHTML("<img id='" + uid
        + "' src='counting-backwards.png' width='16' height='16'>");
    Document.get().getBody().appendChild(div);
    final Image image = Image.wrap(Document.get().getElementById(uid));

    assertEquals(0, image.getOriginLeft());
View Full Code Here

    assertEquals("bold", elem.getStyle().getProperty("fontWeight"));
    assertEquals(resources.style().prettyText(), elem.getClassName());
  }

  public void testDomAccessInHtml() {
    DivElement sideBar = widgetUi.sideBar;
    assertTrue("sideBar should start: \"This could\"",
        sideBar.getInnerText().startsWith("This could"));
    assertTrue("sideBar should end: \"example:\"",
        sideBar.getInnerText().endsWith("like that..."));
    assertEquals("Should have no id", "", sideBar.getAttribute("id"));
  }
View Full Code Here

  }

  public void testRequestAnimationFrame() {
    delayTestFinish(TEST_TIMEOUT);
    final double startTime = Duration.currentTimeMillis();
    DivElement element = Document.get().createDivElement();
    scheduler.requestAnimationFrame(new AnimationCallback() {
      @Override
      public void execute(double timestamp) {
        // Make sure timestamp is not a high-res timestamp (see issue 8570)
        assertTrue(timestamp >= startTime);
View Full Code Here

    fooReceiver = new MockFooReceiver();
    UiRendererUi.getRenderer().onBrowserEvent(fooReceiver, eventAtParent, uiRoot, new Foo("one"), "two");
    assertEquals(0, fooReceiver.handlerCalled);

    // At an element besides the parent does not fire either
    DivElement externalDiv = Document.get().createDivElement();
    Document.get().getBody().appendChild(externalDiv);
    NativeEvent eventAtDiv = createMockNativeEvent(externalDiv, "click");
    fooReceiver = new MockFooReceiver();
    UiRendererUi.getRenderer().onBrowserEvent(fooReceiver, eventAtDiv, uiRoot, new Foo("one"), "two");
    assertEquals(0, fooReceiver.handlerCalled);
View Full Code Here

TOP

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

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.