Thanks Thomas. On Nov 14, 12:31 am, Thomas Broyer <[email protected]> wrote: > Yes, GWT doesn't "chain" rules (which can be great, when what you want is > to override). > > To overcome this, you have to code a "provider" or "factory" for the > LoginResources and use your replace-with rule on that factory (see sample > code below). > > Either that, or heavily use dependency injection, so that all you have to > do is to declare that whenever an instance of LoginResources is needed, > then an instance of RichLoginResources should be given instead. WIth GIN, > it's as easy as: bind(LoginResources.class).to(RichLoginResources.class); > > class LoginResourcesFactory { > public LoginResources newInstance() { > return GWT.create(LoginResources.class); > } > > } > > class RichLoginResourcesFactory extends LoginResourcesFactory { > public LoginResources newInstance() { > return GWT.create(RichLoginResources.class); > } > > } > > <replace-with class="theme.standard.RichLoginResourcesFactory"> > <when-type-is class="bla.LoginResourcesFactory" /> > </replace-with>
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
