The documentation said that you should not use JSInterop in production.
Could you specify what can be used in production and what part cannot?
Thank you
Michael
Am Mittwoch, 29. Oktober 2014 16:44:42 UTC+1 schrieb Ray Cromwell:
Whether you use $wnd.SomeJsObject or SomeJsObject depends on the
@Ray Cromwell thank you for your answer. One last question regarding the
creation of JSInterop objects.
Is it @JsType(prototype=SomeJsObject) or
@JsType(prototype=$wnd.SomeJsObject) ?
Consider an interface
@JsType
interface Test {
void do();
}
How do I instantiate such an interface? The
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
thank oyu Jens. What about my first question:
Is it @JsType(prototype=SomeJsObject) or
@JsType(prototype=$wnd.SomeJsObject) ?
Best
Michael
Am Mittwoch, 29. Oktober 2014 14:45:33 UTC+1 schrieb Jens:
Consider an interface
@JsType
interface Test {
void do();
}
How do I instantiate
Whether you use $wnd.SomeJsObject or SomeJsObject depends on the following:
1) whether you want 'instanceof' to only work on objects that come
from the host page
2) whether or not you're going to extend/subtype JS objects
In most cases, you want $wnd.SomeJsObject, however there are cases
where
Just FYI, we were planning to drop the $wnd and isNative last time we
discussed about it..
On Wed, Oct 29, 2014 at 10:01 AM, confile michael.gorsk...@googlemail.com
wrote:
Thank you Ray. This is a good explanation. It should be added to the docs.
Best
Michael
Am Mittwoch, 29. Oktober 2014
What is the difference in using the following?
*@JsType(prototype=Window**)* and *@JsType *
It does not become very clear from the documentation.
Here is the interface I implemented:
@JsType(prototype=Window)
public interface MyWindow {
public static abstract class Statics {
public
GWT.create() doesn't work to create Js interfaces. It's part of the
GWT deferred binding system and can only be bound to concrete Java
subtypes. (GWT.create uses the 'new' operator)
JsInterop is going to move towards Java8 syntax for the use case you
describe, e.g
@JsType
interface Window {
Okay great. But what is the difference between the following?
*@JsType(prototype=Window**)* and *@JsType *
Also could you please explain when to use isNative = true?
Am Dienstag, 28. Oktober 2014 17:06:47 UTC+1 schrieb Ray Cromwell:
GWT.create() doesn't work to create Js interfaces. It's
@JsType(prototype=Window) means that x instanceof Window will return
false if the underlying object isn't a Window. That is, the GWT compiler
generates a JS instanceof operator with the specified prototype.
Otherwise, @JsType interfaces are treated like JavaScriptObject overlay
types as far as
@Ray Cromwell will the @Entry annotation for JSInterop be included in GWT
2.7? I think this is essential to handle errors raised by JavaScript.
Am Sonntag, 5. Oktober 2014 08:32:26 UTC+2 schrieb Ray Cromwell:
Using default methods in Java8 is exactly how we plan to allow
specifying method
We are not really making a release for JsInterop for 2.7 and it is not
meant to be used in production and missing a lot of stuff.
The released stuff is just something that people can play with and give
some feedback.
On Wed, Oct 8, 2014 at 10:31 AM, confile michael.gorsk...@googlemail.com
wrote:
Using default methods in Java8 is exactly how we plan to allow
specifying method bodies without using JSOs. We are also going to
introduce a new annotation, @JsFinal to declare these methods final
(which you can't do on interfaces) to make it a compile time error for
subclasses to override them.
Consider the following static JavaScript function:
THREE.ImageUtils = {
loadTexture: function (url) { ... }
}
The way I use to create the static function with JsInterop is to create an
interface for ImageUtils and then create an inner abstract class MyStatic
which contains the static
Yes, but it will require Java8, which allows interfaces to contain
static methods. Here's how you'll do it soon when the Java8 stuff
lands:
@JsType
public interface ImageUtils {
public static Texture loadTexture(String url) { return
js($wnd.THREE.ImageUtils.loadTexture($0), url); }
}
+Ray Cromwell:
Suppose the following definition:
@JsType(prototype = jQuery)
public interface JQueryElement {
JQueryElement append(JQueryElement element);
@JsProperty
JQueryElement html();
void data(String key, String value);
Object val();
void on(String
+Ray Cromwell:
Suppose the following definition:
@JsType(prototype = jQuery)
public interface JQueryElement {
JQueryElement append(JQueryElement element);
@JsProperty
JQueryElement html();
void data(String key, String value);
Object val();
void on(String
17 matches
Mail list logo