historyHandler.register(placeController, eventBus, place);
/** * Legacy method tied to the old location for {@link EventBus}. * * @deprecated use {@link #register(PlaceController, EventBus, Place)} */ @Deprecated public com.google.gwt.event.shared.HandlerRegistration register(PlaceController placeController, com.google.gwt.event.shared.EventBus eventBus, Place defaultPlace) { return new LegacyHandlerWrapper(register(placeController, (EventBus) eventBus, defaultPlace)); }
/** * Legacy method tied to the old location for {@link EventBus}. * * @deprecated use {@link #register(PlaceController, EventBus, Place)} */ @Deprecated public com.google.gwt.event.shared.HandlerRegistration register(PlaceController placeController, com.google.gwt.event.shared.EventBus eventBus, Place defaultPlace) { return new LegacyHandlerWrapper(register(placeController, (EventBus) eventBus, defaultPlace)); }
/** * Legacy method tied to the old location for {@link EventBus}. * * @deprecated use {@link #register(PlaceController, EventBus, Place)} */ @Deprecated public com.google.gwt.event.shared.HandlerRegistration register(PlaceController placeController, com.google.gwt.event.shared.EventBus eventBus, Place defaultPlace) { return new LegacyHandlerWrapper(register(placeController, (EventBus) eventBus, defaultPlace)); }
public void setDefaultPlace(Place defaultPlace) { this.defaultPlace = defaultPlace; if (this.historyRegistration != null) { this.historyRegistration.removeHandler(); } this.historyRegistration = this.historyHandler.register(this, EventBus.get(), this.defaultPlace); }
public void setDefaultPlace(Place defaultPlace) { this.defaultPlace = defaultPlace; if (this.historyRegistration != null) { this.historyRegistration.removeHandler(); } this.historyRegistration = this.historyHandler.register(this, EventBus.get(), this.defaultPlace); }
@Test public void testFindPlaceIsSetUp() throws Exception { verify( placeHistoryHandler ).register( eq( placeController ), eq( eventBus ), any( FindPlace.class ) ); }
historyHandler.register(placeController, eventBus, DEFAULT_PLACE);
private void init(ApplicationContext applicationContext) { // Start ActivityManager for the main widget with our ActivityMapper ActivityMapper activityMapper = applicationContext.activityMapper(this); ActivityManager activityManager = new ActivityManager(activityMapper, eventBus); activityManager.setDisplay(appWidget); // Start PlaceHistoryHandler with our PlaceHistoryMapper final PlaceHistoryMapper historyMapper = applicationContext.placeHistoryMapper(); PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper); historyHandler.register(placeController, eventBus, applicationContext.defaultPlace()); RootPanel.get("pageContent").add(appWidget); applicationContext.initialise(this); // Goes to the place represented on URL else default place historyHandler.handleCurrentHistory(); History.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { Place place = historyMapper.getPlace(event.getValue()); if (place != null) { placeController.goTo(place); } } }); }
@Override public void onModuleLoad() { populateMenu(); // Create view container final SimplePanel container = new SimplePanel(); container.setStyleName("container requestor-showcase-container"); RootPanel.get().add(container); // Main Factory (Dependency Injector) ShowcaseClientFactory clientFactory = CLIENT_FACTORY; EventBus eventBus = clientFactory.getEventBus(); PlaceController placeController = clientFactory.getPlaceController(); // Activity-Place binding ActivityMapper activityMapper = new ShowcaseActivityMapper(); ActivityManager activityManager = new ActivityManager(activityMapper, eventBus); activityManager.setDisplay(container); // Place-History binding PlaceHistoryMapper historyMapper = new ShowcasePlaceHistoryMapper(); PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper); historyHandler.register(placeController, eventBus, defaultPlace); // Add Loading widget RootPanel.get().add(new Loading(eventBus)); // Goes to place represented on URL or default place historyHandler.handleCurrentHistory(); }