This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationPresenter | |
extends Presenter<ApplicationPresenter.MyView, ApplicationPresenter.MyProxy> | |
implements ApplicationUiHandlers { // Added the UiHandlers | |
interface MyView extends View, HasUiHandlers<ApplicationUiHandlers> { | |
void displayUsername(String username); | |
} | |
// ... | |
@Inject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add these bindings | |
install(new DefaultModule.Builder().tokenFormatter(RouteTokenFormatter.class).build()); | |
bind(UserService.class).to(UserServiceImpl.class).asEagerSingleton(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arcbees.client.application.users; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.jukito.JukitoRunner; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import com.arcbees.client.application.services.UserService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arcbees.client.application.users; | |
import java.util.Map; | |
import com.arcbees.client.application.services.UserService; | |
import com.arcbees.client.place.NameTokens; | |
import com.google.inject.Inject; | |
import com.google.web.bindery.event.shared.EventBus; | |
import com.gwtplatform.mvp.client.Presenter; | |
import com.gwtplatform.mvp.client.View; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arcbees.client.application.events; | |
import com.google.gwt.event.shared.GwtEvent; | |
import com.google.gwt.event.shared.HasHandlers; | |
public class UserDeletedEvent extends GwtEvent<UserDeletedEventHandler> { | |
public static Type<UserDeletedEventHandler> TYPE = new Type<>(); | |
@Override | |
public Type<UserDeletedEventHandler> getAssociatedType() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arcbees.client.application.services; | |
import org.jukito.JukitoRunner; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import com.arcbees.client.application.events.UserDeletedEvent; | |
import com.google.inject.Inject; | |
import com.google.web.bindery.event.shared.EventBus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arcbees.client.application.services; | |
import java.util.HashMap; | |
import java.util.Map; | |
import com.arcbees.client.application.events.UserDeletedEvent; | |
import com.google.gwt.event.shared.GwtEvent; | |
import com.google.gwt.event.shared.HasHandlers; | |
import com.google.inject.Inject; | |
import com.google.web.bindery.event.shared.EventBus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UsersPresenter extends Presenter<UsersPresenter.MyView, UsersPresenter.MyProxy> | |
implements UsersViewUiHandlers, UserDeletedEventHandler { | |
// ... | |
@Inject | |
UsersPresenter( | |
EventBus eventBus, | |
MyView view, | |
MyProxy proxy, | |
UserService userService) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UsersPresenter extends Presenter<UsersPresenter.MyView, UsersPresenter.MyProxy> | |
implements UsersViewUiHandlers, UserDeletedEventHandler { | |
// ... | |
private void reloadUsers() { | |
Map<Integer, String> users = userService.getUsers(); | |
getView().displayUsers(users); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.arcbees.client.application.users; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.jukito.JukitoModule; | |
import org.jukito.JukitoRunner; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; |