Hi,

I've defined the following instance method in a class extending
JavaScriptObject :

public final void Vip_write() {
                ...
        }

I'd like to access this java method from JSNI.
For example in function like :

public final static native void called(Vip v) /*-{
                v...@com.test.vip::Vip_write();
        }-*/;

But this is rejected but the compiler, complaining about "Illegal
reference to instance method 'Vip_write' in type 'com.test.Vip', which
is an overlay type; only static references to overlay types are
allowed from JSNI".

Behind the scene, I've seen that Vip_write is translated to the
following javascript :

function $Vip_write(this$static){
 ...
}

So I'd like to see something in my called(Vip v) javascript
translation like :

$Vip_write(v);

Of course I could manually insert this exact call in the JSNI code,
but this would then fail as soon as I compile obfuscated.

Another solution would be to define an extra static method

public final static void Vip_write_static(Vip v) {
                v.Vip_write();
        }

and then call this static method from JSNI. This works but this
translates to

function $Vip_write_static(v) {
                $Vip_write(v);
        }

which is right, but not really very optimized !

Any idea ?

Thanks,

Matthieu

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to