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
`static class` `PlaceController.DefaultDelegate` Default implementation of `PlaceController.Delegate`, based on `Window`.
`static interface` `PlaceController.Delegate` Optional delegate in charge of Window-related events.

### Constructor Summary

Constructors
Constructor and Description
`PlaceController(EventBus eventBus)` Deprecated. use `PlaceController(EventBus)`
`PlaceController(EventBus eventBus)` Create a new PlaceController with a `PlaceController.DefaultDelegate`.
`PlaceController(EventBus eventBus, PlaceController.Delegate delegate)` Deprecated. use `PlaceController(EventBus, Delegate)`
`PlaceController(EventBus eventBus, PlaceController.Delegate delegate)` Create a new PlaceController.

### Method Summary

All Methods Instance Methods Concrete Methods
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PlaceController

    @Deprecated
    public PlaceController(EventBus eventBus)

Deprecated. use `PlaceController(EventBus)`
Legacy method tied to the old location for `EventBus`.

#### PlaceController

    @Deprecated
    public PlaceController(EventBus eventBus,
                                       PlaceController.Delegate delegate)

Deprecated. use `PlaceController(EventBus, Delegate)`
Legacy method tied to the old location for `EventBus`.

#### PlaceController

    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`

#### PlaceController

    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

### Method Detail

#### getWhere

    public Place getWhere()

Returns the current place.

Returns:
  a `Place` instance

#### 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 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 `PlaceController.Delegate.confirm(String)` (which is typically a call to `Window.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

#### log

    java.util.logging.Logger log()

Visible for testing.