Using @StructuralType

47 views
Skip to first unread message

sariz

unread,
Jul 19, 2012, 7:34:07 PM7/19/12
to gwtex...@googlegroups.com
I am trying to use @StructuralType to export interfaces like this:

@Export
@StructuralType
public interface Foo extends Exportable{
   public void method1();
   public void method2();
}

In javascript: 

bar.setFoo({
    method1: function(e) { ... }
    method2: function(e) { ... }
});

This doesn't work for me. Am I using it incorrectly?
Thanks!

Manuel Carrasco Moñino

unread,
Jul 20, 2012, 1:12:19 AM7/20/12
to gwtex...@googlegroups.com
@StructuralType is not implemented yet. If you take a look to the code there is a lot to do with this idea before having it implemented [1].

- Manolo

Jay

unread,
Feb 20, 2013, 11:44:02 AM2/20/13
to gwtex...@googlegroups.com
Is there any sort of design doc (besides Ray's blog post from March 2009) outlining the desired approach and/or abstract steps it would take to implement this? Even just a common set of TODOs in the code that can be searched for?

Thanks,

jay

Manuel Carrasco Moñino

unread,
Feb 21, 2013, 2:46:15 AM2/21/13
to gwtex...@googlegroups.com
Hi Jay

As you point, the only document around this idea is the Ray's post, there is no much about this idea in the code apart from the javadoc in annotation classes (StructuralType, SType) and some references to them in some classes JsStructuraTypeField, JsExportableClassType, ExportableTypeOracle y ClassExporter. 

As you can see the implementation code is incomplete, not functional at all, and could be outdated since gwtexporter has had many changes since these first steps.

If you wanted to go ahead with structural types,  the main class you have to study is the ClassExporter where happens the writing of deferred classes, although I'm aware the code can be difficult to understand. There are a good set of tests which check almost the features in the library, those tests are not standard gwt ones since then export classes to js and usage and assertions are performed in jsni. I had thought on go ahead with this as well, but I havent had enough spare time to face it yet.


- Manolo

--
Has recibido este mensaje porque estás suscrito al grupo "gwtexporter" de Grupos de Google.
Para anular la suscripción a este grupo y dejar de recibir sus correos electrónicos, envía un correo electrónico a gwtexporter...@googlegroups.com.
Para obtener más opciones, visita https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages