Wednesday, January 25, 2012

Re: CssResource + Custom Deferred Binding?

That worked exactly as needed, Thank You Colin!

On Jan 24, 7:34 pm, Colin Alworth <niloc...@gmail.com> wrote:
> You can't replace the static method through replace-with, but you can make
> the static methods call GWT.create on a class that has one implementation,
> and use replace-with to swap in another one. For example,
> om.mycompany.client.ui.CssGradientUtil.getLinearGradient could be a static
> method that looks like
>     CssGradientUtil util = GWT.create(CssGradientUtil.class);
>     return util.getGradient(...);
>
> To make that work, have getGradient be a non-static method, overridden in
> CssGradientUtilIE7. GWT.create will go through the rebind rules and create
> an instance that fits best, and you can use normal java inheritance to get
> the overridden method.
>
> There is no need for the first replace-with block, that replaces a class
> with itself.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment