Package org.geomajas.plugin.geocoder.client.event

Examples of org.geomajas.plugin.geocoder.client.event.SelectAlternativeHandler


  @Test
  public void testSelectAlternativeEvent() throws Exception {
    final ObjectContainer container = new ObjectContainer();
    GeocoderPresenter presenter = new GeocoderPresenter(null, null);
    presenter.setSelectAlternativeHandler(new SelectAlternativeHandler() {
      public void onSelectAlternative(SelectAlternativeEvent event) {
        container.object = "ok";
      }
    });
    presenter.goToLocation(alternativesResponse, "3");
View Full Code Here


  @Test
  public void testSelectAlternativeOnlyOneEvent() throws Exception {
    final ObjectContainer container = new ObjectContainer();
    GeocoderPresenter presenter = new GeocoderPresenter(null, null);
    presenter.setSelectAlternativeHandler(new SelectAlternativeHandler() {
      public void onSelectAlternative(SelectAlternativeEvent event) {
        Assert.fail("This handler should be overwritten");
      }
    });
    presenter.setSelectAlternativeHandler(new SelectAlternativeHandler() {
      public void onSelectAlternative(SelectAlternativeEvent event) {
        container.object = "ok";
      }
    });
    presenter.goToLocation(alternativesResponse, "4");
View Full Code Here

   * @param handler select alternative handler
   * @return handler registration.
   */
  public HandlerRegistration setSelectAlternativeHandler(SelectAlternativeHandler handler) {
    if (handlerManager.getHandlerCount(SelectAlternativeHandler.TYPE) > 0) {
      SelectAlternativeHandler previous = handlerManager.getHandler(SelectAlternativeHandler.TYPE, 0);
      handlerManager.removeHandler(SelectAlternativeHandler.TYPE, previous);
    }
    return handlerManager.addHandler(SelectAlternativeHandler.TYPE, handler);
  }
View Full Code Here

TOP

Related Classes of org.geomajas.plugin.geocoder.client.event.SelectAlternativeHandler

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.