You'd have to create an instance of List that wraps your JsArray, or is a
copy of its content.
Using a few tricks [1], you could make it as easy as:
public List<Widget> getWidgets() {
return
Collections.unmodifiableList(Arrays.asList(JsArrays.toArray(getWidgetsAsJsArray())));
}
private native JsArray<Widget> getWidgetsAsJsArrays() /*-{
return this.widgets || [];
}-*/;
[1]
http://code.google.com/p/gwt-in-the-air/source/browse/trunk/src/net/ltgt/gwt/jscollections/client/JsArrays.java
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.