[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions

2009-05-30 Thread Thomas Broyer
On 29 mai, 02:18, Vitali Lovich vlov...@gmail.com wrote: It would be nice if there was a way to wrap Java methods with an opaque Javascript function object so that you could pass them around in the native code (obviously there are issues with compiler optimizations in this case). Ideally,

[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions

2009-05-30 Thread Ray Cromwell
There's a type safe trick to doing it for all methods that return a value, see: http://cromwellian.blogspot.com/2006_07_01_archive.html which is based on this: http://weblogs.java.net/blog/alexwinston/archive/2005/04/strongly_types_1.html With my GWT.create() relaxation proposal, you could

[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions

2009-05-29 Thread John Tamplin
On Thu, May 28, 2009 at 8:18 PM, Vitali Lovich vlov...@gmail.com wrote: It would be nice if there was a way to wrap Java methods with an opaque Javascript function object so that you could pass them around in the native code (obviously there are issues with compiler optimizations in this

[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions

2009-05-29 Thread Vitali Lovich
On Fri, May 29, 2009 at 9:42 AM, John Tamplin j...@google.com wrote: On Thu, May 28, 2009 at 8:18 PM, Vitali Lovich vlov...@gmail.com wrote: It would be nice if there was a way to wrap Java methods with an opaque Javascript function object so that you could pass them around in the native

[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions

2009-05-29 Thread John Tamplin
On Fri, May 29, 2009 at 10:42 AM, Vitali Lovich vlov...@gmail.com wrote: I was thinking more along the lines of JavascriptFunction foo = MyClass.bar.method or something like that. That way, you could do dynamic function invocation without ever needing JSNI. It's also a lot easier to write

[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions

2009-05-29 Thread John Tamplin
On Fri, May 29, 2009 at 11:31 AM, Vitali Lovich vlov...@gmail.com wrote: The way you get a method reference in pure Java is via reflection, which in general is not feasible though there have been some discussions of allowing it when everything can be evaluated at compile time (ie, all

[gwt-contrib] Re: Feature idea - reference Java methods as Javascript functions

2009-05-29 Thread Vitali Lovich
On Fri, May 29, 2009 at 11:59 AM, John Tamplin j...@google.com wrote: On Fri, May 29, 2009 at 11:31 AM, Vitali Lovich vlov...@gmail.com wrote: The way you get a method reference in pure Java is via reflection, which in general is not feasible though there have been some discussions of