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 NestedSlot SLOT_MAIN = new NestedSlot(); | |
public static final SingleSlot SLOT_SIDE_PANEL = new SingleSlot(); |
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 | |
protected void onBind() { | |
setInSlot(SLOT_MAIN, shoppingCartPresenter); | |
addRegisteredHandler(CheckoutContinueEvent.TYPE, this); | |
} | |
@Override | |
public void onCheckoutContinue(CheckoutContinueEvent event) { | |
if (getChildren(SLOT_MAIN).contains(shoppingCartPresenter)) { |
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
addToSlot(SLOT_MAIN_PRODUCTS, productFactory.create(ProductWidgetType.MAIN_LEFT, shirt)); | |
addToSlot(SLOT_MAIN_PRODUCTS, productFactory.create(ProductWidgetType.MAIN_RIGHT, bag)); |
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 this to vm.options (intelliJ) | |
-Duser.language=en -Duser.country=US |
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 ToasterWidgetPresenter extends PresenterWidget<ToasterWidgetPresenter.MyView> | |
implements ToasterWidgetUiHandlers { | |
interface MyView extends View, HasUiHandlers<ToasterWidgetUiHandlers> { | |
void setToaster(Toaster toaster); | |
} | |
private final RestDispatch dispatch; | |
private final ToasterResource resource; | |
@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
@Override | |
public void onLaunch(String coordinates, String power) { | |
validateFields(coordinates, power); | |
dispatch.execute(resource.launch(coordinates, power), new AsyncCallback<Void>() { | |
@Override | |
public void onFailure(Throwable throwable) { | |
// Handle failure | |
} |
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> | |
<h1>Toaster Launcher</h1> | |
<label>Coordinates (x, y, z):</label><br/> | |
<g:TextBox ui:field="launchCoordinates"/><br/> | |
<label>Power:</label><br/> | |
<g:TextBox ui:field="launchPower"/><br/> | |
<g:Button ui:field="launchButton" text="LAUNCH!"/><br/> | |
<g:SimplePanel ui:field="container"/> |
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 LauncherView extends ViewWithUiHandlers<LauncherPresenter> implements LauncherPresenter.MyView { | |
interface Binder extends UiBinder<Widget, LauncherView> { | |
} | |
@UiField | |
TextBox launchCoordinates; | |
@UiField | |
TextBox launchPower; | |
@UiField | |
Button launchButton; |
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.inject.Inject; | |
import com.google.web.bindery.event.shared.EventBus; | |
import com.gwtplatform.mvp.client.HasUiHandlers; | |
import com.gwtplatform.mvp.client.PresenterWidget; | |
import com.gwtplatform.mvp.client.View; | |
public class ToasterWidgetPresenter extends PresenterWidget<ToasterWidgetPresenter.MyView> | |
implements ToasterWidgetUiHandlers { | |
interface MyView extends View, HasUiHandlers<ToasterWidgetUiHandlers> { | |
void setToaster(Toaster toaster); |
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 ClientModule extends AbstractPresenterModule { | |
@Override | |
protected void configure() { | |
install(new DefaultModule.Builder().build()); | |
install(new ApplicationModule()); | |
bindConstant().annotatedWith(DefaultPlace.class).to(NameTokens.LOGIN); | |
bindConstant().annotatedWith(ErrorPlace.class).to(NameTokens.LOGIN); | |
bindConstant().annotatedWith(UnauthorizedPlace.class).to(NameTokens.LOGIN); |
NewerOlder