public class

PlaceController

extends Object
java.lang.Object
   ↳ com.google.gwt.place.shared.PlaceController

Class Overview

In charge of the user's location in the app.

Summary

Nested Classes
class PlaceController.DefaultDelegate Default implementation of PlaceController.DefaultDelegate, based on Window
interface PlaceController.Delegate Optional delegate in charge of Window-related events. 
Public Constructors
PlaceController(EventBus eventBus)
Create a new PlaceController with a PlaceController.DefaultDelegate.
PlaceController(EventBus eventBus, PlaceController.Delegate delegate)
Create a new PlaceController.
Public Methods
Place getWhere()
Returns the current place.
void goTo(Place newPlace)
Request a change to a new place.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PlaceController (EventBus eventBus)

Create a new PlaceController with a PlaceController.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 the EventBus

public PlaceController (EventBus eventBus, PlaceController.Delegate delegate)

Create a new PlaceController.

Parameters
eventBus the EventBus
delegate the PlaceController.Delegate in charge of Window-related events

Public Methods

public Place getWhere ()

Returns the current place.

Returns

public void goTo (Place newPlace)

Request a change to a new place. It is not a given that we'll actually get there. First a PlaceChangeRequestEvent will be posted to the event bus. If any receivers post a warning message to that event, it will be presented to the user via confirm(String) (which is typically a call to confirm(String)). If she cancels, the current location will not change. Otherwise, the location changes and a PlaceChangeEvent is posted announcing the new place.

Parameters
newPlace a Place instance