Package com.google.gwt.place.shared
Class PlaceController
- java.lang.Object
-
- com.google.gwt.place.shared.PlaceController
-
public class PlaceController extends java.lang.ObjectIn charge of the user's location in the app.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPlaceController.DefaultDelegateDefault implementation ofPlaceController.Delegate, based onWindow.static interfacePlaceController.DelegateOptional delegate in charge of Window-related events.
-
Constructor Summary
Constructors Constructor Description PlaceController(EventBus eventBus)Deprecated.PlaceController(EventBus eventBus, PlaceController.Delegate delegate)Deprecated.PlaceController(EventBus eventBus)Create a new PlaceController with aPlaceController.DefaultDelegate.PlaceController(EventBus eventBus, PlaceController.Delegate delegate)Create a new PlaceController.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlacegetWhere()Returns the current place.voidgoTo(Place newPlace)Request a change to a new place.(package private) java.util.logging.Loggerlog()Visible for testing.
-
-
-
Constructor Detail
-
PlaceController
@Deprecated public PlaceController(EventBus eventBus)
Deprecated.Legacy method tied to the old location forEventBus.
-
PlaceController
@Deprecated public PlaceController(EventBus eventBus, PlaceController.Delegate delegate)
Deprecated.Legacy method tied to the old location forEventBus.
-
PlaceController
public PlaceController(EventBus eventBus)
Create a new PlaceController with aPlaceController.DefaultDelegate. The DefaultDelegate is created via a call to GWT.create(), so an alternative default implementation can be provided through <replace-with> rules in a.gwt.xmlfile.- Parameters:
eventBus- theEventBus
-
PlaceController
public PlaceController(EventBus eventBus, PlaceController.Delegate delegate)
Create a new PlaceController.- Parameters:
eventBus- theEventBusdelegate- thePlaceController.Delegatein charge of Window-related events
-
-
Method Detail
-
goTo
public void goTo(Place newPlace)
Request a change to a new place. It is not a given that we'll actually get there. First aPlaceChangeRequestEventwill be posted to the event bus. If any receivers post a warning message to that event, it will be presented to the user viaPlaceController.Delegate.confirm(String)(which is typically a call toWindow.confirm(String)). If she cancels, the current location will not change. Otherwise, the location changes and aPlaceChangeEventis posted announcing the new place.- Parameters:
newPlace- aPlaceinstance
-
log
java.util.logging.Logger log()
Visible for testing.
-
-