gwtgwt-elemental

Is it possible to use the GWT Elemental collections in a non-elemental app?


Is it possible to use the Elemental collections (elemental.util.Collections, elemental.util.ArrayOfInt, elemental.util.MapFromStringTo, etc) in a non-elemental GWT app. I'm using these modules already:

<!-- Inherit the core Web Toolkit stuff.                        -->
<inherits name='com.google.gwt.user.User' />

<!-- Inherit the RequestBuilder stuff.                        -->
<inherits name="com.google.gwt.http.HTTP" />


<!--  Inherit GQuery -->
<inherits name='com.google.gwt.query.Query' />

But I'd like to start using the lightweight Elemental collections rather than Java ArrayList and HashMap. Is that possible? Would it be fairly easy to port from Elemental into it's own module for this purpose? Thanks for you help.


Solution

  • Sure, all you have to do is include the following declaration in your module descriptor (*.gwt.xml):

    <inherits name="elemental.Elemental"/>
    

    See the elemental example on the GWT trunk.