Skip to content

Instantly share code, notes, and snippets.

View Elrhino's full-sized avatar

Renaud Lainé Elrhino

View GitHub Profile
@Elrhino
Elrhino / hehe.java
Created August 28, 2015 15:19
Test Gist
Hehehe!
@Elrhino
Elrhino / devsite-upload.sh
Created September 3, 2015 21:15
dev-site uploading 1 liner
mvn clean install -pl -webapp && cd uploader/ && ./upload.sh localhost && cd ..
@Elrhino
Elrhino / LoggedInGatekeeper.java
Created October 19, 2015 16:27
Code snippets from toaster launcher part 2
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.annotations.DefaultGatekeeper;
import com.gwtplatform.mvp.client.proxy.Gatekeeper;
@DefaultGatekeeper
public class LoggedInGatekeeper implements Gatekeeper {
private CurrentUser currentUser;
@Inject
public LoggedInGatekeeper(CurrentUser currentUser) {
@Elrhino
Elrhino / structure.txt
Last active October 20, 2015 04:27
Code snippets from toaster launcher part 2
|-- api
| |-- ApiPaths.java
| |-- RestDispatchModule.java
| |-- Toaster.java
| `-- ToasterResource.java
|-- application
| |-- ApplicationModule.java
| |-- ApplicationPresenter.java
| |-- ApplicationView.java
| |-- ApplicationView.ui.xml
@Elrhino
Elrhino / LoginPresenter.java
Last active October 20, 2015 04:55
Code snippets from toaster launcher part 2
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;
@Elrhino
Elrhino / LoginView.ui.xml
Created October 19, 2015 16:36
Code snippets from toaster launcher part 2
<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>
@Elrhino
Elrhino / LoginView.java
Last active October 19, 2015 21:38
Code snippet from toaster launcher part 2
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;
@Elrhino
Elrhino / LoginPresenter.java
Created October 19, 2015 17:57
Code snippets from toaster launcher part 2
@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);
}
@Elrhino
Elrhino / LauncherPresenter.java
Last active October 27, 2015 00:55
Code snippets from toaster launcher part 2
public static final Slot SLOT_CONTENT = new Slot();
private final ToasterPresenterWidget toasterPresenterWidget;
@Inject
LauncherPresenter(
EventBus eventBus,
MyView view,
MyProxy proxy,
ToasterPresenterWidget toasterPresenterWidget) {
@Elrhino
Elrhino / RestDispatchModule.java
Created October 19, 2015 18:32
Code snippets from toaster launcher part 2
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());