>
> Consider an interface
>
> @JsType
> interface Test {
> void do();
> }
>
> How do I instantiate such an interface?
>
For now you need to use a JSNI factory method. May it be in a static inner
class or a dedicated factory class for all your JsTypes.
With GWT 3.0 (and Java8 support) you can use a static factory method on the
interface which uses GWT.jsni() or GWT.js() or whatever name that special
GWT method will have. So in GWT 3.0 it will probably look like:
@JsType
interface Test {
static Test create() { return GWT.js("new Test()"); }
void do();
}
-- J.
--
You received this message because you are subscribed to the Google Groups "GWT
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-web-toolkit-contributors/dddf3130-f84a-4003-984f-74d781a8da60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.