// Path: src/main/java/com/nuvola/myproject/client/application/ApplicationModule.java
// public class ApplicationModule extends AbstractPresenterModule {
//     @Override
//     protected void configure() {
//         bind(ApplicationPresenter.class).asEagerSingleton();
//         bind(ApplicationPresenter.MyProxy.class).asEagerSingleton();
//         bind(ApplicationPresenter.MyView.class).to(ApplicationView.class);
//     }
// }
// 
// Path: src/main/java/com/nuvola/myproject/client/login/LoginModule.java
// public class LoginModule extends AbstractPresenterModule {
//     @Override
//     protected void configure() {
//         bindPresenter(LoginPresenter.class, LoginPresenter.MyView.class, LoginView.class,
//                 LoginPresenter.MyProxy.class);
//     }
// }
// 
// Path: src/main/java/com/nuvola/myproject/client/services/ServiceModule.java
// public class ServiceModule extends AbstractGinModule {
//     @Override
//     protected void configure() {
//         install(new RestDispatchAsyncModule.Builder().build());
//     }
// 
//     @Provides
//     @RestApplicationPath
//     String getApplicationPath() {
//         String baseUrl = GWT.getHostPageBaseURL();
//         if (baseUrl.endsWith("/")) {
//             baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
//         }
// 
//         return baseUrl;
//     }
// }
// 
// Path: src/main/java/com/nuvola/myproject/client/security/CurrentUser.java
// public class CurrentUser {
//     private boolean loggedIn;
// 
//     public boolean isLoggedIn() {
//         return loggedIn;
//     }
// 
//     public void setLoggedIn(boolean loggedIn) {
//         this.loggedIn = loggedIn;
//     }
// }


import com.google.gwt.inject.client.AbstractGinModule;
import com.gwtplatform.mvp.client.annotations.DefaultPlace;
import com.gwtplatform.mvp.client.annotations.ErrorPlace;
import com.gwtplatform.mvp.client.annotations.UnauthorizedPlace;
import com.gwtplatform.mvp.client.gin.DefaultModule;
import com.gwtplatform.mvp.client.proxy.DefaultPlaceManager;
import com.gwtplatform.mvp.shared.proxy.RouteTokenFormatter;
import com.nuvola.myproject.client.application.ApplicationModule;
import com.nuvola.myproject.client.login.LoginModule;
import com.nuvola.myproject.client.services.ServiceModule;
import com.nuvola.myproject.client.security.CurrentUser;
package com.nuvola.myproject.client;


public class MyModule extends AbstractGinModule {
    @Override
    protected void configure() {
        install(new DefaultModule.Builder()
                .placeManager(DefaultPlaceManager.class)
                .tokenFormatter(RouteTokenFormatter.class)
                .build());

        bind(CurrentUser.class).asEagerSingleton();

        bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.getHome());
        bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.getHome());
        bindConstant().annotatedWith(UnauthorizedPlace.class).to(NameTokens.getLogin());

        install(new ServiceModule());
// Path: src/main/java/com/nuvola/myproject/client/application/ApplicationModule.java
// public class ApplicationModule extends AbstractPresenterModule {
//     @Override
//     protected void configure() {
//         bind(ApplicationPresenter.class).asEagerSingleton();
//         bind(ApplicationPresenter.MyProxy.class).asEagerSingleton();
//         bind(ApplicationPresenter.MyView.class).to(ApplicationView.class);
//     }
// }
// 
// Path: src/main/java/com/nuvola/myproject/client/login/LoginModule.java
// public class LoginModule extends AbstractPresenterModule {
//     @Override
//     protected void configure() {
//         bindPresenter(LoginPresenter.class, LoginPresenter.MyView.class, LoginView.class,
//                 LoginPresenter.MyProxy.class);
//     }
// }
// 
// Path: src/main/java/com/nuvola/myproject/client/services/ServiceModule.java
// public class ServiceModule extends AbstractGinModule {
//     @Override
//     protected void configure() {
//         install(new RestDispatchAsyncModule.Builder().build());
//     }
// 
//     @Provides
//     @RestApplicationPath
//     String getApplicationPath() {
//         String baseUrl = GWT.getHostPageBaseURL();
//         if (baseUrl.endsWith("/")) {
//             baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
//         }
// 
//         return baseUrl;
//     }
// }
// 
// Path: src/main/java/com/nuvola/myproject/client/security/CurrentUser.java
// public class CurrentUser {
//     private boolean loggedIn;
// 
//     public boolean isLoggedIn() {
//         return loggedIn;
//     }
// 
//     public void setLoggedIn(boolean loggedIn) {
//         this.loggedIn = loggedIn;
//     }
// }


// Path: src/main/java/com/nuvola/myproject/client/MyModule.java
import com.google.gwt.inject.client.AbstractGinModule;
import com.gwtplatform.mvp.client.annotations.DefaultPlace;
import com.gwtplatform.mvp.client.annotations.ErrorPlace;
import com.gwtplatform.mvp.client.annotations.UnauthorizedPlace;
import com.gwtplatform.mvp.client.gin.DefaultModule;
import com.gwtplatform.mvp.client.proxy.DefaultPlaceManager;
import com.gwtplatform.mvp.shared.proxy.RouteTokenFormatter;
import com.nuvola.myproject.client.application.ApplicationModule;
import com.nuvola.myproject.client.login.LoginModule;
import com.nuvola.myproject.client.services.ServiceModule;
import com.nuvola.myproject.client.security.CurrentUser;

package com.nuvola.myproject.client;


public class MyModule extends AbstractGinModule {
    @Override
    protected void configure() {
        install(new DefaultModule.Builder()
                .placeManager(DefaultPlaceManager.class)
                .tokenFormatter(RouteTokenFormatter.class)
                .build());

        bind(CurrentUser.class).asEagerSingleton();

        bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.getHome());
        bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.getHome());
        bindConstant().annotatedWith(UnauthorizedPlace.class).to(NameTokens.getLogin());

        install(new ServiceModule());
        install(new LoginModule());