Last active
December 21, 2015 10:49
-
-
Save slugmandrew/6294908 to your computer and use it in GitHub Desktop.
AccountsModule and Presenter/View/UiBinder triplet
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 AccountsModule extends AbstractPresenterModule | |
{ | |
@Override | |
protected void configure() | |
{ | |
bindPresenter(AccountsPresenter.class, AccountsPresenter.MyView.class, AccountsView.class, AccountsPresenter.MyProxy.class); | |
} | |
} |
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 AccountsPresenter extends Presenter<AccountsPresenter.MyView, AccountsPresenter.MyProxy> | |
{ | |
public interface MyView extends View | |
{ | |
//HasClickHandlers getAddButton(); | |
} | |
@ProxyStandard | |
@NameToken(NameTokens.accounts) | |
public interface MyProxy extends ProxyPlace<AccountsPresenter> | |
{ | |
} | |
private List<Account> accountList; | |
private DispatchAsync dispatchAsync; | |
private PlaceManager placeManager; | |
@Inject | |
public AccountsPresenter(EventBus eventBus, MyView view, MyProxy proxy, DispatchAsync dispatchAsync, PlaceManager placeManager) | |
{ | |
super(eventBus, view, proxy, ApplicationPresenter.TYPE_MainContent); | |
this.dispatchAsync = dispatchAsync; | |
this.placeManager = placeManager; | |
} |
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 AccountsView extends ViewImpl implements AccountsPresenter.MyView | |
{ | |
public interface Binder extends UiBinder<Widget, AccountsView> | |
{ | |
} | |
@Inject | |
public AccountsView(Binder uiBinder) | |
{ | |
initWidget(uiBinder.createAndBindUi(this)); | |
} | |
} |
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
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> | |
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:b='urn:import:com.github.gwtbootstrap.client.ui'> | |
<ui:style src="../../resources/GlobalStyles.css" field="global" /> | |
<g:HTMLPanel> | |
<b:FluidContainer> | |
<b:FluidRow> | |
<b:Column size="12"> | |
<b:Heading size="2" subtext="Your complete list of clients">Accounts</b:Heading> | |
<!-- <b:ButtonToolbar> --> | |
<!-- <b:Button ui:field="addButton" type="PRIMARY" icon="PLUS">Create Account</b:Button> --> | |
<!-- <b:Button type="INFO" icon="COG">Another Function</b:Button> --> | |
<!-- <b:Button type="INVERSE" icon="WARNING_SIGN">And Another</b:Button> --> | |
<!-- </b:ButtonToolbar> --> | |
</b:Column> | |
</b:FluidRow> | |
</b:FluidContainer> | |
</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
onModuleLoad() threw an exception | |
Exception while loading module com.gwtplatform.mvp.client.ApplicationControllerImpl. See Development Mode for details. | |
java.lang.reflect.InvocationTargetException | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
at java.lang.reflect.Method.invoke(Method.java:606) | |
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:406) | |
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) | |
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526) | |
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) | |
at java.lang.Thread.run(Thread.java:724) | |
Caused by: java.lang.ExceptionInInitializerError | |
at com.gwtplatform.mvp.client.ApplicationControllerImpl.init(ApplicationControllerImpl.java:9) | |
at com.gwtplatform.mvp.client.ApplicationControllerImpl.onModuleLoad(ApplicationControllerImpl.java:15) | |
... 9 more | |
Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.gwtplatform.mvp.client.DesktopGinjector' (did you forget to inherit a required module?) | |
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53) | |
at com.google.gwt.core.shared.GWT.create(GWT.java:57) | |
at com.google.gwt.core.client.GWT.create(GWT.java:85) | |
at com.gwtplatform.mvp.client.DesktopGinjectorProvider.get(DesktopGinjectorProvider.java:8) | |
at com.gwtplatform.mvp.client.ClientGinjector.<clinit>(ClientGinjector.java:11) | |
... 11 more | |
Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) | |
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:605) | |
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465) | |
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) | |
... 15 more |
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
00:00:38.271 [ERROR] Error injecting com.utilitiessavings.usavappv7.client.application.accounts.AccountsPresenter$MyProxy: Unable to create or inherit binding: No @Inject or default constructor found for com.utilitiessavings.usavappv7.client.application.accounts.AccountsPresenter$MyProxy Path to required node: com.utilitiessavings.usavappv7.client.application.accounts.AccountsPresenter$MyProxy [com.gwtplatform.mvp.client.gin.AbstractPresenterModule.bindPresenter(AbstractPresenterModule.java:124)] | |
00:00:38.277 [ERROR] Error injecting com.utilitiessavings.usavappv7.client.application.accounts.AccountsView$Binder: Unable to create or inherit binding: No @Inject or default constructor found for com.utilitiessavings.usavappv7.client.application.accounts.AccountsView$Binder Path to required node: com.utilitiessavings.usavappv7.client.application.accounts.AccountsView [com.gwtplatform.mvp.client.gin.AbstractPresenterModule.bindPresenter(AbstractPresenterModule.java:123)] -> com.utilitiessavings.usavappv7.client.application.accounts.AccountsView$Binder [@Inject constructor of com.utilitiessavings.usavappv7.client.application.accounts.AccountsView] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment