Instantly share code, notes, and snippets.

What would you like to do?
public class UserPresenter
extends Presenter<UserPresenter.MyView, UserPresenter.MyProxy>
implements UserUiHandlers {
interface MyView extends View, HasUiHandlers<UserUiHandlers> {
void displayUser(User user);
// ...
private final PlaceManager placeManager;
private final ResourceDelegate<UserApi> userApiResourceDelegate;
EventBus eventBus,
MyView view,
MyProxy proxy,
PlaceManager placeManager,
ResourceDelegate<UserApi> userApiResourceDelegate) {
super(eventBus, view, proxy, RevealType.Root);
this.placeManager = placeManager;
this.userApiResourceDelegate = userApiResourceDelegate;
public void prepareFromRequest(PlaceRequest request) {
int userId = parseUserIdFromPlaceRequest(request);
userApiResourceDelegate.withCallback(new RestCallbackImpl<User>() {
public void onSuccess(User user) {
private int parseUserIdFromPlaceRequest(PlaceRequest placeRequest) {
String idParameter = placeRequest.getParameter(NameTokens.PARAM_ID, "");
return Integer.parseInt(idParameter);
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment