Package com.google.gwt.place.shared

Examples of com.google.gwt.place.shared.PlaceChangeEvent


        Scheduler.get().scheduleDeferred(new ScheduledCommand() {

          @Override
          public void execute() {
            ignorePlaceChange = false;
            PlaceChangeEvent poll = placeChangeStack.poll();
            onPlaceChange(poll);
          }
        });

      } else {
View Full Code Here


    };

    manager = new ActivityManager(map, eventBus);
    manager.setDisplay(realDisplay);

    eventBus.fireEvent(new PlaceChangeEvent(place1));
    com.google.web.bindery.event.shared.EventBus activeEventBus =
        manager.getActiveEventBus();
    activeEventBus.addHandler(Event.TYPE, new Handler());
    assertEquals(1, eventBus.getCount(Event.TYPE));

    eventBus.fireEvent(new PlaceChangeEvent(place2));
    assertEquals(0, eventBus.getCount(Event.TYPE));
  }
View Full Code Here

    assertNull(realDisplay.widget);
    assertFalse(asyncActivity1.stopped);
    assertFalse(asyncActivity1.canceled);
    assertNull(asyncActivity1.display);

    eventBus.fireEvent(new PlaceChangeEvent(place1));
    assertNull(realDisplay.widget);
    assertFalse(asyncActivity1.stopped);
    assertFalse(asyncActivity1.canceled);
    assertNotNull(asyncActivity1.display);

    asyncActivity1.finish();
    assertEquals(asyncActivity1.view, realDisplay.widget);
    assertFalse(asyncActivity1.stopped);
    assertFalse(asyncActivity1.canceled);

    event = new PlaceChangeRequestEvent(place2);
    eventBus.fireEvent(event);
    assertNull(event.getWarning());
    assertEquals(asyncActivity1.view, realDisplay.widget);
    assertFalse(asyncActivity1.stopped);
    assertFalse(asyncActivity1.canceled);
    assertFalse(asyncActivity2.stopped);
    assertFalse(asyncActivity2.canceled);
    assertNull(asyncActivity2.display);

    eventBus.fireEvent(new PlaceChangeEvent(place2));
    assertNull(realDisplay.widget);
    assertFalse(asyncActivity1.canceled);
    assertTrue(asyncActivity1.stopped);
    assertFalse(asyncActivity2.stopped);
    assertFalse(asyncActivity2.canceled);
View Full Code Here

    assertNull(realDisplay.widget);
    assertFalse(asyncActivity1.stopped);
    assertFalse(asyncActivity1.canceled);
    assertNull(asyncActivity1.display);

    eventBus.fireEvent(new PlaceChangeEvent(place1));
    assertNull(realDisplay.widget);
    assertFalse(asyncActivity1.stopped);
    assertFalse(asyncActivity1.canceled);
    assertNotNull(asyncActivity1.display);

    event = new PlaceChangeRequestEvent(place2);
    eventBus.fireEvent(event);
    assertNull(event.getWarning());
    assertNull(realDisplay.widget);
    assertFalse(asyncActivity1.stopped);
    assertFalse(asyncActivity1.canceled);

    eventBus.fireEvent(new PlaceChangeEvent(place2));
    assertNull(realDisplay.widget);
    assertTrue(asyncActivity1.canceled);
    assertFalse(asyncActivity1.stopped);
    assertFalse(ayncActivity2.stopped);
    assertFalse(ayncActivity2.canceled);
View Full Code Here

        super.onStop();
        bus.addHandler(Event.TYPE, new Handler());
      }
    };

    PlaceChangeEvent event = new PlaceChangeEvent(place1);
    eventBus.fireEvent(event);
    assertEquals(1, eventBus.getCount(Event.TYPE));

    event = new PlaceChangeEvent(place2);
    eventBus.fireEvent(event);
    assertEquals(0, eventBus.getCount(Event.TYPE));

    // Make sure we didn't nuke the ActivityManager's own handlers
    assertEquals(1, eventBus.getCount(PlaceChangeEvent.TYPE));
View Full Code Here

    };

    manager.setDisplay(realDisplay);

    try {
      PlaceChangeEvent event = new PlaceChangeEvent(place1);
      eventBus.fireEvent(event);
      assertEquals(1, eventBus.getCount(Event.TYPE));

      event = new PlaceChangeEvent(place2);
      eventBus.fireEvent(event);

      fail("Expected exception");
    } catch (UmbrellaException e) {
      // EventBus throws this one
View Full Code Here

    };

    manager.setDisplay(realDisplay);

    try {
      PlaceChangeEvent event = new PlaceChangeEvent(place1);
      eventBus.fireEvent(event);
      assertEquals(1, eventBus.getCount(Event.TYPE));

      event = new PlaceChangeEvent(place2);
      eventBus.fireEvent(event);

      fail("Expected exception");
    } catch (UmbrellaException e) {
      // EventBus throws this one
View Full Code Here

   */
  public void testNullDisplayOnPlaceChange() {
    manager.setDisplay(realDisplay);
   
    // Start an activity
    manager.onPlaceChange(new PlaceChangeEvent(place1));
   
    /*
     * Now we're going to place2. During PlaceChangeEvent dispatch,
     * someone kills the manager's display.
     */
    manager.setDisplay(null);
   
    // Now the place change event reaches the manager
    manager.onPlaceChange(new PlaceChangeEvent(place2));
   
    assertNull(activity2.display);
    assertTrue(activity1.stopped);
  }
View Full Code Here

    manager = new ActivityManager(map, eventBus);
    manager.setDisplay(realDisplay);
   
    // Start an activity
    manager.onPlaceChange(new PlaceChangeEvent(place1));

    // Kill the manager
    manager.setDisplay(null);
   
    // The activity is ready to play
View Full Code Here

        place1);
    eventBus.fireEvent(event);
    assertNull(event.getWarning());
    assertNull(realDisplay.widget);

    eventBus.fireEvent(new PlaceChangeEvent(place1));
    assertEquals(activity1.view, realDisplay.widget);

    event = new PlaceChangeRequestEvent(place2);
    eventBus.fireEvent(event);
    assertEquals(activity1.stopWarning, event.getWarning());
View Full Code Here

TOP

Related Classes of com.google.gwt.place.shared.PlaceChangeEvent

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.