Package com.google.gwt.dom.client

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


  protected void failNow(String failMsg) {
    fail("Expected failure (" + failMsg + ")");
  }

  protected void failViaUncaughtException(final String failMsg) {
    ButtonElement btn = Document.get().createPushButtonElement();
    Document.get().getBody().appendChild(btn);
    Event.sinkEvents(btn, Event.ONCLICK);

    EventListener listener = new EventListener() {
      @Override
      public void onBrowserEvent(Event event) {
        failNow(failMsg);
      }
    };

    DOM.setEventListener(btn, listener);
    btn.click();
  }
View Full Code Here


   @Test
   public void appendChilds() {
      // Arrange
      BaseElement c0 = Document.get().createBaseElement();
      ButtonElement c1 = Document.get().createPushButtonElement();

      // Act
      n.appendChild(c0);
      n.appendChild(c1);
View Full Code Here

   public void getFirstChild() {
      // Pre-Assert
      assertNull(n.getFirstChild());

      // Arrange
      ButtonElement be0 = Document.get().createPushButtonElement();
      ButtonElement be1 = Document.get().createPushButtonElement();
      n.appendChild(be0);
      n.appendChild(be1);

      // Act & Assert
      assertEquals(be0, n.getFirstChild());
View Full Code Here

   public void getLastChild() {
      // Pre-Assert
      assertNull(n.getLastChild());

      // Arrange
      ButtonElement be0 = Document.get().createPushButtonElement();
      ButtonElement be1 = Document.get().createPushButtonElement();
      n.appendChild(be0);
      n.appendChild(be1);

      // Act & Assert
      assertEquals(be1, n.getLastChild());
View Full Code Here

   public void getNextSibling() {
      // Pre-Assert
      assertNull(n.getNextSibling());

      // Arrange
      ButtonElement be0 = Document.get().createPushButtonElement();
      ButtonElement be1 = Document.get().createPushButtonElement();
      n.appendChild(be0);
      n.appendChild(be1);

      // Act & Assert
      assertEquals(be1, be0.getNextSibling());
View Full Code Here

   public void getPreviousSibling() {
      // Pre-Assert
      assertNull(n.getPreviousSibling());

      // Arrange
      ButtonElement be0 = Document.get().createPushButtonElement();
      ButtonElement be1 = Document.get().createPushButtonElement();
      n.appendChild(be0);
      n.appendChild(be1);

      // Act & Assert
      assertEquals(be0, be1.getPreviousSibling());
   }
View Full Code Here

   }

   @Test
   public void insertBefore() {
      // Arrange
      ButtonElement be0 = Document.get().createPushButtonElement();
      ButtonElement be1 = Document.get().createPushButtonElement();
      ButtonElement be2 = Document.get().createPushButtonElement();
      ButtonElement be3 = Document.get().createPushButtonElement();
      ButtonElement be4 = Document.get().createPushButtonElement();
      ButtonElement be5 = Document.get().createPushButtonElement();
      n.appendChild(be0);
      n.appendChild(be2);

      // Act & Assert
      n.insertBefore(be1, be2);
View Full Code Here

   @Test
   public void removeChild() {
      // Arrange
      BaseElement c0 = Document.get().createBaseElement();
      ButtonElement c1 = Document.get().createPushButtonElement();
      n.appendChild(c0);
      n.appendChild(c1);

      // Act
      n.removeChild(c1);
View Full Code Here

   @Test
   public void replaceChild() {
      // Arrange
      BaseElement c0 = Document.get().createBaseElement();
      ButtonElement c1 = Document.get().createPushButtonElement();
      AnchorElement c2 = Document.get().createAnchorElement();
      n.appendChild(c0);
      n.appendChild(c1);

      // Act
View Full Code Here

   @Test
   public void getElementByTagName() {
      // Arrange
      AnchorElement ae0 = Document.get().createAnchorElement();
      AnchorElement ae1 = Document.get().createAnchorElement();
      ButtonElement be = Document.get().createPushButtonElement();
      e.appendChild(ae0);
      e.appendChild(ae1);
      e.appendChild(be);

      // Act
View Full Code Here

TOP

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

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.