Open confile opened 9 years ago
The generator doesn't only collect the name token, it generate the proxy, which instantiate the presenter in due time, allowing clean code splitting when needed. The nametoken is used to identify the presenter uniquely following a "web" pattern.
As a hint "where" to search, you should take a look at the proxy generators. You can also create your own proxy, but that is undocumented. We've been creating dynamic proxies for a while now, while it's not obvious, it's really useful for CMS and dynamic tabs.
@christiangoudreau Thank you for your help. I see that for my StartPagePresenter
the following proxy has been generated:
public class StartPagePresenterMyProxyImpl extends com.gwtplatform.mvp.client.proxy.ProxyPlaceImpl<StartPagePresenter> implements buddyis.mobile.client.app.start.StartPagePresenter.MyProxy, com.gwtplatform.mvp.client.DelayedBind {
private com.gwtplatform.mvp.client.ClientGinjector ginjector;
public static class WrappedProxy
extends com.gwtplatform.mvp.client.proxy.ProxyImpl<StartPagePresenter> implements com.gwtplatform.mvp.client.DelayedBind {
private com.gwtplatform.mvp.client.ClientGinjector ginjector;
public WrappedProxy() {
}
@Override
public void delayedBind(Ginjector baseGinjector) {
ginjector = (com.gwtplatform.mvp.client.ClientGinjector)baseGinjector;
bind(ginjector.getPlaceManager(),
ginjector.getEventBus());
presenter = new CodeSplitProvider<StartPagePresenter>( ginjector.getbuddyismobileclientappstartStartPagePresenter() );
RevealContentHandler<StartPagePresenter> revealContentHandler = new RevealContentHandler<StartPagePresenter>( eventBus, this );
getEventBus().addHandler( StartPagePresenter.CONTENT_SLOT, revealContentHandler );
}
}
public StartPagePresenterMyProxyImpl() {
DelayedBindRegistry.register(this);
}
@Override
public void delayedBind(Ginjector baseGinjector) {
ginjector = (com.gwtplatform.mvp.client.ClientGinjector)baseGinjector;
bind(ginjector.getPlaceManager(),
ginjector.getEventBus());
WrappedProxy wrappedProxy = GWT.create(WrappedProxy.class);
wrappedProxy.delayedBind( ginjector );
setProxy(wrappedProxy);
String[] nameToken = {"/start"};
String[] gatekeeperParams = null;
setPlace(new com.gwtplatform.mvp.client.proxy.PlaceImpl( nameToken ));
}
}
I can see that StartPagePresenterMyProxyImpl
is an implementation of StartPagePresenter.MyProxy
.
Why is a WrappedProxy
created inside and set with setProxy(wrappedProxy);
to StartPagePresenterMyProxyImpl
.
Since StartPagePresenterMyProxyImpl
is a proxy implementation why does a ProxyImpl. get another Proxy? I did not get the reason for that?
Closing as, from what I see, the question has been answered. Don't hesitate to ask your question on the forum.
@olafleur No id do not see any answer.
Oh sorry, I didn't saw that you had other questions. Reopening. ;-)
I a controller which is also a place I do:
I know that there is a Generator which collects all the
@NameToken
name tokens and creates aBut, what else is done with the
@NameToken
s? Where does a proxyPlace get its nameToken? Could you give my a hint where to search?