Thanks for the tip. I'll go with that. On Saturday, February 16, 2013 12:34:05 AM UTC+1, Thomas Broyer wrote: > > > > On Saturday, February 16, 2013 12:13:04 AM UTC+1, alucard wrote: >> >> On Friday, February 15, 2013 11:15:40 PM UTC+1, Thomas Broyer wrote: >> >>> String is a special beast, as it's emulated by a JS String. It wouldn't >>> surprise me if that use case weren't supported. I grep'ed the source code >>> of GWT and didn't find any such use. >>> >> Yeah. I found this in the docs for the emulated string: >> >> For efficiency we handle String in a specialized way, in fact, a >> java.lang.String is actually implemented as a native JavaScript String. >> Then >> we just load up the prototype of the JavaScript String object with the >> appropriate instance methods. >> >> So it should be possible to use the instance methods but not with the >> [email protected]... notation. Any ideas on what could be used >> instead? >>> >>> >>> > You can use a "bridge" method: > > public static int stringCompareTo(String a, String b) { > return a.compareTo(b); > } > > private static native int test(String str) /*-{ > return > @com.example.MyClass::stringCompareTo(Ljava/lang/String;Ljava/lang/String;)(str, > > "test"); > }-*/; >
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
