如果您确切知道应该使用哪些参数,则可以执行以下操作(删除 :: 之后的其他新行)
private native void buildTabs(TabConfiguration config) /*-{
$wnd.NAMESPACE.lib.buildTabs({hide:
config.@com.yournamehere.TabConfiguration::
getHide()(),
placeholder:
config.@com.yournamehere.TabConfiguration::
getPlaceholder()()});
}-*/;
GWT 文档中的一个小片段:
public native void bar(JSNIExample x, String s) /*-{
// Call instance method instanceFoo() on this
this.@com.google.gwt.examples.JSNIExample::instanceFoo(Ljava/lang/String;)(s);
// Call instance method instanceFoo() on x
x.@com.google.gwt.examples.JSNIExample::instanceFoo(Ljava/lang/String;)(s);
// Call static method staticFoo()
@com.google.gwt.examples.JSNIExample::staticFoo(Ljava/lang/String;)(s);
// Read instance field on this
var val = this.@com.google.gwt.examples.JSNIExample::myInstanceField;
// Write instance field on x
x.@com.google.gwt.examples.JSNIExample::myInstanceField = val + " and stuff";
// Read static field (no qualifier)
@com.google.gwt.examples.JSNIExample::myStaticField = val + " and stuff";
}-*/;