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
@Override | |
public void confirm(String username, String password) { | |
if (validateCredentials(username, password)) { | |
currentUser.setLoggedIn(true); | |
// TODO: Navigate to another place. | |
} | |
} | |
private boolean validateCredentials(String username, String password) { |
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
import javax.ws.rs.Consumes; | |
import javax.ws.rs.FormParam; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.POST; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import com.gwtplatform.dispatch.rest.shared.RestAction; |
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 Toaster { | |
private String name; | |
private String coordinates; | |
private String power; | |
private Toaster() { | |
// For serialization | |
} |
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
import com.google.gwt.inject.client.AbstractGinModule; | |
import com.gwtplatform.dispatch.rest.client.RestApplicationPath; | |
import com.gwtplatform.dispatch.rest.client.gin.RestDispatchAsyncModule; | |
public class RestDispatchModule extends AbstractGinModule { | |
@Override | |
protected void configure() { | |
RestDispatchAsyncModule.Builder dispatchBuilder = new RestDispatchAsyncModule.Builder(); | |
install(dispatchBuilder.build()); |
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 static final Slot SLOT_CONTENT = new Slot(); | |
private final ToasterPresenterWidget toasterPresenterWidget; | |
@Inject | |
LauncherPresenter( | |
EventBus eventBus, | |
MyView view, | |
MyProxy proxy, | |
ToasterPresenterWidget toasterPresenterWidget) { |
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
@Override | |
public void confirm(String username, String password) { | |
if (validateCredentials(username, password)) { | |
currentUser.setLoggedIn(true); | |
PlaceRequest placeRequest = new PlaceRequest.Builder() | |
.nameToken(NameTokens.HOME) | |
.build(); | |
placeManager.revealPlace(placeRequest); | |
} |
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
import javax.inject.Inject; | |
import com.google.gwt.event.dom.client.ClickEvent; | |
import com.google.gwt.uibinder.client.UiBinder; | |
import com.google.gwt.uibinder.client.UiField; | |
import com.google.gwt.uibinder.client.UiHandler; | |
import com.google.gwt.user.client.ui.Button; | |
import com.google.gwt.user.client.ui.PasswordTextBox; | |
import com.google.gwt.user.client.ui.TextBox; | |
import com.google.gwt.user.client.ui.Widget; |
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
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' | |
xmlns:g='urn:import:com.google.gwt.user.client.ui'> | |
<g:HTMLPanel> | |
<g:TextBox ui:field="username"/><br/> | |
<g:PasswordTextBox ui:field="password"/><br/> | |
<g:Button ui:field="confirm" text="Login"/> | |
</g:HTMLPanel> | |
</ui:UiBinder> |
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
import javax.inject.Inject; | |
import com.google.web.bindery.event.shared.EventBus; | |
import com.gwtplatform.mvp.client.HasUiHandlers; | |
import com.gwtplatform.mvp.client.Presenter; | |
import com.gwtplatform.mvp.client.View; | |
import com.gwtplatform.mvp.client.annotations.NameToken; | |
import com.gwtplatform.mvp.client.annotations.NoGatekeeper; | |
import com.gwtplatform.mvp.client.annotations.ProxyStandard; |
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
|-- api | |
| |-- ApiPaths.java | |
| |-- RestDispatchModule.java | |
| |-- Toaster.java | |
| `-- ToasterResource.java | |
|-- application | |
| |-- ApplicationModule.java | |
| |-- ApplicationPresenter.java | |
| |-- ApplicationView.java | |
| |-- ApplicationView.ui.xml |