Example usage for com.google.gwt.place.shared PlaceChangeRequestEvent PlaceChangeRequestEvent

List of usage examples for com.google.gwt.place.shared PlaceChangeRequestEvent PlaceChangeRequestEvent

Introduction

In this page you can find the example usage for com.google.gwt.place.shared PlaceChangeRequestEvent PlaceChangeRequestEvent.

Prototype

public PlaceChangeRequestEvent(Place newPlace) 

Source Link

Document

Constructs a PlaceChangeRequestEvent for the given Place .

Usage

From source file:com.sfeir.common.gwt.client.mvp.PlaceController.java

License:Apache License

/**
 * /*from  w w w.j  a v a 2s.c om*/
 * @param newPlace The new place you want to goto
 * @return null if there are no problems to go to the new Place or the message instead
 */
public String maybeGoTo(Place newPlace) {
    PlaceChangeRequestEvent willChange = new PlaceChangeRequestEvent(newPlace);
    eventBus.fireEvent(willChange);
    String warning = willChange.getWarning();
    return warning;
}

From source file:com.tasktop.c2c.server.profile.web.ui.client.place.AppPlaceController.java

License:Open Source License

private boolean maybeGoTo(Place newPlace) {
    if (goingTo != null && goingTo == newPlace) {
        return true;
    }//from w  w  w  . j  av a  2s  .  c  o  m

    PlaceChangeRequestEvent willChange = new PlaceChangeRequestEvent(newPlace);
    eventBus.fireEvent(willChange);
    String warning = willChange.getWarning();

    if (warning == null || delegate.confirm(warning)) {
        return true;
    } else {
        // Keep url in sync when cancled
        History.newItem(placeHistoryMapper.getToken(getWhere()), false);
        return false;
    }
}

From source file:fr.putnami.pwt.core.mvp.client.MvpController.java

License:Open Source License

@Override
public void goTo(final Place newPlace) {

    if (this.getWhere().equals(newPlace)) {
        return;/*from  w w w  .j a  v  a2 s .  com*/
    }

    PlaceChangeRequestEvent willChange = new PlaceChangeRequestEvent(newPlace);
    EventBus.get().fireEvent(willChange);
    String warning = willChange.getWarning();
    if (warning == null || Window.confirm(warning)) {
        this.doGo(newPlace);
    } else {
        this.goTo(this.getWhere());
    }
}