net.customware.gwt.presenter.client.gin
Class ProvidedPresenterPlace<T extends Presenter>
java.lang.Object
net.customware.gwt.presenter.client.place.Place
net.customware.gwt.presenter.client.place.PresenterPlace<T>
net.customware.gwt.presenter.client.gin.ProvidedPresenterPlace<T>
public abstract class ProvidedPresenterPlace<T extends Presenter>
- extends PresenterPlace<T>
A place that represents a Presenter, constructed by using a Provider.
This is the recommended method for creating places when using GIN, since it will help
avoid any circular dependencies when you have two Presenters that want to link to each
other. Implementing classes should simply inject a Provider rather than
the actual Presenter class directly, and pass it to the super() constructor.
Also, places should not be @Singleton values.
Eg:
public class FooPlace extends ProvidedPresenterPlace {
\@Inject
public FooPlace( Provider presenter ) {
super( presenter );
}
}
- Author:
- David Peterson
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ProvidedPresenterPlace
public ProvidedPresenterPlace(com.google.inject.Provider<T> presenter)
getPresenter
public T getPresenter()
- Specified by:
getPresenter in class PresenterPlace<T extends Presenter>
preparePresenter
protected void preparePresenter(PlaceRequest request,
T presenter)
- Override this method to handle input values from the request that should
be passed to the presenter before being revealed. The default implementation
does nothing. For example:
presenter.setId( request.getParam( "id" );
- Specified by:
preparePresenter in class PresenterPlace<T extends Presenter>
- Parameters:
request - The request.presenter - The presenter.
prepareRequest
protected PlaceRequest prepareRequest(PlaceRequest request,
T presenter)
- Prepares the request based on the current state of the presenter. If the
presenter has state that you wish to be reflected in the History token,
add it to the request before returning. Eg:
return request.with( "id", presenter.getId() );
The default implementation simply returns the request unchanged.
- Specified by:
prepareRequest in class PresenterPlace<T extends Presenter>
- Parameters:
request - The current request.presenter - The presenter.
- Returns:
- The updated request.
Copyright © 2010 customware.net. All Rights Reserved.