package com.changestuffs.kantor.client.gin;
import com.changestuffs.kantor.client.core.components.MainPresenter;
import com.changestuffs.kantor.client.core.components.MainView;
import com.changestuffs.kantor.client.core.home.HomePresenter;
import com.changestuffs.kantor.client.core.home.HomeView;
import com.changestuffs.kantor.client.place.NameTokens;
import com.gwtplatform.dispatch.client.gin.DispatchAsyncModule;
import com.gwtplatform.mvp.client.annotations.DefaultPlace;
import com.gwtplatform.mvp.client.annotations.ErrorPlace;
import com.gwtplatform.mvp.client.annotations.GaAccount;
import com.gwtplatform.mvp.client.annotations.UnauthorizedPlace;
import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
import com.gwtplatform.mvp.client.gin.DefaultModule;
import com.gwtplatform.mvp.client.googleanalytics.GoogleAnalyticsNavigationTracker;
import com.gwtplatform.mvp.client.proxy.DefaultPlaceManager;
public class ClientModule extends AbstractPresenterModule {
@Override
protected void configure() {
install(new DefaultModule(DefaultPlaceManager.class));
install(new DispatchAsyncModule());
bindConstant().annotatedWith(GaAccount.class).to("UA-43538164-1");
bind(GoogleAnalyticsNavigationTracker.class).asEagerSingleton();
bindPresenter(MainPresenter.class, MainPresenter.MyView.class, MainView.class, MainPresenter.MyProxy.class);
bindPresenter(HomePresenter.class, HomePresenter.MyView.class, HomeView.class, HomePresenter.MyProxy.class);
bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.home);
//TODO
bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.home);
bindConstant().annotatedWith(UnauthorizedPlace.class).to(NameTokens.home);
}
}