Package com.google.gwt.place.shared
Class PlaceController
- java.lang.Object
-
- com.google.gwt.place.shared.PlaceController
-
public class PlaceController extends java.lang.Object
In charge of the user's location in the app.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PlaceController.DefaultDelegate
Default implementation ofPlaceController.Delegate
, based onWindow
.static interface
PlaceController.Delegate
Optional 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 Place
getWhere()
Returns the current place.void
goTo(Place newPlace)
Request a change to a new place.(package private) java.util.logging.Logger
log()
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.xml
file.- Parameters:
eventBus
- theEventBus
-
PlaceController
public PlaceController(EventBus eventBus, PlaceController.Delegate delegate)
Create a new PlaceController.- Parameters:
eventBus
- theEventBus
delegate
- thePlaceController.Delegate
in 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 aPlaceChangeRequestEvent
will 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 aPlaceChangeEvent
is posted announcing the new place.- Parameters:
newPlace
- aPlace
instance
-
log
java.util.logging.Logger log()
Visible for testing.
-
-