auto-gwt and html5 metamodel

61 views
Skip to first unread message

Anton Hughes

unread,
Jul 21, 2015, 3:20:07 AM7/21/15
to xtend...@googlegroups.com
Hi

Firstly, I'm new to xtend.

I use a flavor of GWT called Errai. There are several benefits to Errai over GWT. One in particular is you can use html for the visual layout rather than uibinder.

My question is, how can I convert auto-gwt to work with html rather than uibinder? If I had a metamodel of html5, would be make it easier to implement this? If yes, are there any guides to working with metamodels with xtend?

Thanks and regards
Anton

Anton Kosyakov

unread,
Jul 21, 2015, 3:32:29 AM7/21/15
to xtend...@googlegroups.com
Hi Anton,

You will need to implement an active annotation similar to WithUiBinding (https://github.com/xtext/auto-gwt/blob/master/src/main/java/de/itemis/xtend/auto/gwt/WithUiBinding.xtend) that parses html files and adds fields to a form. Having java API to work with html5 model will definitely help to implement such annotation.

More about Active Annotations here: https://www.eclipse.org/xtend/documentation/204_activeannotations.html

Best regards,
Anton

--
You received this message because you are subscribed to the Google Groups "Xtend Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xtend-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anton Hughes

unread,
Jul 21, 2015, 3:42:06 AM7/21/15
to xtend...@googlegroups.com
Thanks Anton

Do you have any advice/info/links on how to work with ecore metamodels with xtend?

Thanks

Anton Kosyakov

unread,
Jul 21, 2015, 4:12:44 AM7/21/15
to xtend...@googlegroups.com
With Xtend you can use any existing java APIs, so you can generate java API for your ecore metamodel and use it to load the concrete instance.
There are plenty material on EMF describing how to do it: https://www.eclipse.org/modeling/emf/docs/. This one could be particularly interesting: http://www.theserverside.com/news/1364302/Binding-XML-to-Java

BTW why do you need ecore model? To parse html you can use standard java APIs, e.g. DocumentBuilder, as we do it for the WithUiBinding annotation: https://github.com/xtext/auto-gwt/blob/master/src/main/java/de/itemis/xtend/auto/gwt/UiBinderParser.xtend Or have a deep look at Errai to learn how they find fields which should be bound and do the same.

Regards,
Anton
Reply all
Reply to author
Forward
0 new messages