Package com.google.gwt.gen2.datepicker.client

Examples of com.google.gwt.gen2.datepicker.client.DateBox


    assertFired(mouse1, mouse2, mouse3);
    assertNotFired(adaptor1, click1, click2);

    // Checks to see if click events are still working.
    reset();
    manager.fireEvent(new ClickEvent(null));
    assertNotFired(mouse1, mouse2, mouse3);
    assertFired(click1, click2, adaptor1);
  }
View Full Code Here


  private void addHandlers(HandlerManager manager) {
    manager.addHandler(MouseDownEvent.TYPE, mouse1);
    manager.addHandler(MouseDownEvent.TYPE, mouse2);
    manager.addHandler(MouseDownEvent.TYPE, adaptor1);
    manager.fireEvent(new MouseDownEvent(null));
    assertEquals(3, manager.getHandlerCount(MouseDownEvent.TYPE));
    assertFired(mouse1, mouse2, adaptor1);
    manager.addHandler(MouseDownEvent.TYPE, mouse3);
    assertEquals(4, manager.getHandlerCount(MouseDownEvent.TYPE));

    manager.addHandler(MouseDownEvent.TYPE, mouse1);
    manager.addHandler(MouseDownEvent.TYPE, mouse2);
    manager.addHandler(MouseDownEvent.TYPE, adaptor1);

    // You can indeed add handlers twice, they will only be removed one at a
    // time though.
    assertEquals(7, manager.getHandlerCount(MouseDownEvent.TYPE));
    manager.addHandler(ClickEvent.TYPE, adaptor1);
    manager.addHandler(ClickEvent.TYPE, click1);
    manager.addHandler(ClickEvent.TYPE, click2);

    assertEquals(7, manager.getHandlerCount(MouseDownEvent.TYPE));
    assertEquals(3, manager.getHandlerCount(ClickEvent.TYPE));

    reset();
    manager.fireEvent(new MouseDownEvent(null));
    assertFired(mouse1, mouse2, mouse3, adaptor1);
    assertNotFired(click1, click2);
  }
View Full Code Here

  public void testRemoveHandlers() {
    HandlerManager manager = new HandlerManager("bogus source");
    addHandlers(manager);
    // Gets rid of first instance.
    manager.removeHandler(MouseDownEvent.TYPE, adaptor1);
    manager.fireEvent(new MouseDownEvent(null));
    assertFired(mouse1, mouse2, mouse3, adaptor1);
    assertNotFired(click1, click2);

    // Gets rid of second instance.
    manager.removeHandler(MouseDownEvent.TYPE, adaptor1);
    reset();
    manager.fireEvent(new MouseDownEvent(null));
    assertFired(mouse1, mouse2, mouse3);
    assertNotFired(adaptor1, click1, click2);

    // Checks to see if click events are still working.
    reset();
View Full Code Here

      }

    });

    reset();
    manager.fireEvent(new MouseDownEvent(null));
    assertFired(mouse1, adaptor1, mouse3);
  }
View Full Code Here

    registry.removeHandler(MouseDownEvent.TYPE, mouse2);
    assertEquals(1, registry.getHandlerCount(MouseDownEvent.TYPE));

    // Check for correct firing.
    reset();
    registry.fireEvent(new MouseDownEvent(null));
    assertFired(mouse1);
    assertNotFired(mouse2);

    registry.removeHandler(MouseDownEvent.TYPE, mouse1);

    // Nothing should happen now.
    reset();
    registry.fireEvent(new MouseDownEvent(null));
    assertNotFired(mouse1);
    assertNotFired(mouse2);

    registry.addHandler(MouseDownEvent.TYPE, mouse2);
    assertEquals(1, registry.getHandlerCount(MouseDownEvent.TYPE));

    // Two should fire
    reset();
    registry.fireEvent(new MouseDownEvent(null));
    assertNotFired(mouse1);
    assertFired(mouse2);
  }
View Full Code Here

    final HandlerManager manager2 = new HandlerManager("source2");

    manager.addHandler(MouseDownEvent.TYPE, mouse1);

    manager.addHandler(MouseDownEvent.TYPE, new MouseDownHandler() {

      public void onMouseDown(MouseDownEvent event) {
        manager2.fireEvent(event);
      }

    });
    manager.addHandler(MouseDownEvent.TYPE, mouse3);
    manager2.addHandler(MouseDownEvent.TYPE, adaptor1);
    manager2.addHandler(MouseDownEvent.TYPE, new MouseDownHandler() {

      public void onMouseDown(MouseDownEvent event) {
        assertEquals("source2", event.getSource());
      }

    });
    manager.addHandler(MouseDownEvent.TYPE, new MouseDownHandler() {

      public void onMouseDown(MouseDownEvent event) {
        assertEquals("source1", event.getSource());
      }
View Full Code Here

    switch (DOM.eventGetType(event)) {
      case Event.ONSCROLL:
        // Reposition the tables on scroll
        scrollTables(false);
        if (dataWrapper.isOrHasChild(target)) {
          fireEvent(new ScrollEvent(event));
        }
        break;

      case Event.ONMOUSEDOWN:
        // Start resizing a header column
View Full Code Here

  }

  public void testKeyEvents() {

    final Flag flag = new Flag();
    manager = new HandlerManager(flag);
    HandlerRegistration downRegistration = manager.addHandler(
        KeyDownEvent.TYPE, new KeyDownHandler() {
          public void onKeyDown(KeyDownEvent event) {
            flag.flag = true;
          }
View Full Code Here

  }

  public void testMouseEvents() {

    final Flag flag = new Flag();
    manager = new HandlerManager(flag);

    HandlerRegistration downRegistration = manager.addHandler(
        MouseDownEvent.TYPE, new MouseDownHandler() {
          public void onMouseDown(MouseDownEvent event) {
            flag.flag = true;
View Full Code Here

  public void testKeyEvents() {

    final Flag flag = new Flag();
    manager = new HandlerManager(flag);
    HandlerRegistration downRegistration = manager.addHandler(
        KeyDownEvent.TYPE, new KeyDownHandler() {
          public void onKeyDown(KeyDownEvent event) {
            flag.flag = true;
          }
        });
    HandlerRegistration upRegistration = manager.addHandler(KeyUpEvent.TYPE,
        new KeyUpHandler() {
          public void onKeyUp(KeyUpEvent event) {
            flag.flag = true;
          }
        });

    HandlerRegistration pressRegistration = manager.addHandler(
        KeyPressEvent.TYPE, new KeyPressHandler() {
          public void onKeyPress(KeyPressEvent event) {
            flag.flag = true;
          }
        });
View Full Code Here

TOP

Related Classes of com.google.gwt.gen2.datepicker.client.DateBox

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.