I want to use a Java Collection in an interface that will be
implemented by an overlay type.

interface Warehouse {
  List<Widget> getWidgets();
}

class WarehouseImpl implements Warehouse {
  final List<Widget> getWidgets() {
    // ... get widgets from model ...
  }
}

class WarehouseJso extends JavaScriptObject implements Warehouse {
  public final native List<Widget> getWidgets() /*-{
    // ... eval JSON data from server listing Widgets ...
  }-*/;
}

Is this possible or will this be possible in the future (when?) ?

The alternative is that my Overlay Type has to implement a client-side
specific method, e.g.
 public final native JsArray getWidgetsAsJsArray() /*-{ ... }-*/;#
which is just plain ugly.

I've heard (http://groups.google.com/group/google-web-toolkit/msg/
7f107fa8b84c1d17) that there may be a JS lightweight Collection
library being worked on - is this true?

In the meanwhile is it technically possible for JsArray to implement
Iterable<T extends JavaScriptObject> so that I can at least declare my
interface to return an Iterable (instead of List) and keep things
looking somewhat consistant. (This would also allow me to use a Java
1.5 for-each loop).

-- 
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.

Reply via email to