declarative way to build/layout UI

23 views
Skip to first unread message

Ainata-Leb

unread,
Jul 12, 2009, 10:38:43 AM7/12/09
to Google Web Toolkit
Is the GWT team working on a declarative way to build/layout UI? Some
XML based way similar to Flex MXML. Or does anyone know if there is a
GWT lib that does that?

mars1412

unread,
Jul 13, 2009, 4:52:51 AM7/13/09
to Google Web Toolkit
maybe UI-binder is what you are looking for:
http://code.google.com/p/google-web-toolkit-incubator/wiki/UiBinder

brett.wooldridge

unread,
Jul 13, 2009, 8:50:27 AM7/13/09
to Google Web Toolkit
I'm waiting for UIBinder as well, but this project seems full featured
and was used on a large project:

http://code.google.com/p/kiyaa/

If the Google guys can't surface UIBinder soon, I may bite the bullet
and use Kiyaa now and convert later. The markup looks fairly similar
between them.

Brett

Ainata-Leb

unread,
Jul 14, 2009, 10:28:24 AM7/14/09
to Google Web Toolkit
Thanks for the info guys, but with the UIBinder it looks like we are
going back to html. What about instantiation/initialization/laying out
GWT widgets?

Thanks.


On Jul 13, 8:50 am, "brett.wooldridge" <brett.wooldri...@gmail.com>
wrote:

brett.wooldridge

unread,
Jul 14, 2009, 11:27:48 PM7/14/09
to Google Web Toolkit
If that's what you're after, I would suggest looking at Kiyaa. It
seems the most robust implementation out there.

brett.wooldridge

unread,
Jul 14, 2009, 11:40:31 PM7/14/09
to Google Web Toolkit
On second reading, what is that UIBinder doesn't do that you want it
to do?

It can do layout:

<ui:UiBinder
xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'>
<g:HTMLPanel>
Hello, <g:ListBox ui:field='listBox'/>.
</g:HTMLPanel>
</ui:UiBinder>

And even "raw" layout:

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
<div>
Hello, <span ui:field='nameSpan'/>.
</div>
</ui:UiBinder>

It instantiates the controls (ListBox in this case), and automatically
binds them to annotated fields:

@UiField ListBox listBox;

Certainly because nobody outside of Google has seen UIBinder it is
early to say what it is or is not capable of, but from my reading of
the proposal it would seem the basics of layout, instantiation, and
initialization are covered. If you want code-generation and the
ability to intermingle layout with code in the same file, certainly
UIBinder isn't the tool, but I would argue that's because doing so
isn't best practice.


On Jul 15, 12:27 pm, "brett.wooldridge" <brett.wooldri...@gmail.com>
wrote:

Thiago

unread,
Jul 28, 2009, 1:25:09 PM7/28/09
to Google Web Toolkit
Hi,

I suggest you to look at Crux ( http://code.google.com/p/crux-framework
).

It provides a declarative way to build UI and some other interesting
features.

Thiago


On 15 jul, 00:40, "brett.wooldridge" <brett.wooldri...@gmail.com>
wrote:
> On second reading, what is that UIBinder doesn't do that you want it
> to do?
>
> It can do layout:
>
> <ui:UiBinder
>   xmlns:ui='urn:ui:com.google.gwt.uibinder'
>   xmlns:g='urn:import:com.google.gwt.user.client.ui'>
>   <g:HTMLPanel>
>     Hello, <g:ListBoxui:field='listBox'/>.
>   </g:HTMLPanel>
> </ui:UiBinder>
>
> And even "raw" layout:
>
> <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
>   <div>
>     Hello, <spanui:field='nameSpan'/>.
> > > > > maybeUI-binder is what you are looking for:http://code.google.com/p/google-web-toolkit-incubator/wiki/UiBinder
>
> > > > > On Jul 12, 4:38 pm, Ainata-Leb <kassem.alsayed....@gmail.com> wrote:
>
> > > > > > Is the GWT team working on adeclarativeway to build/layoutUI? Some

Juraj Vitko

unread,
Jul 29, 2009, 11:34:55 AM7/29/09
to Google Web Toolkit
Hi Brett,

I've already designed, implemented and used a similar framework - use
XML to configure and drive Java components into an UI (not related to
GWT).

In the end, you may come to an conclusion, that configuring Java with
XML is not the right thing to do, because you are losing the static
typing and the "self awarenness" of the Java language, so well
supported by tools like Ecplise.

Imagine the XML reaching sizable proportions - how manageable will it
be? In Eclipse, you do Ctrl+T on a type or function, Ctrl+Alt+H on a
function, or a Java-search on a type and you know everything. You can
also refactor, etc.

Whith XML approach, you first need to evolve the supporting tools, and
it could be a long path. This is not to discourage you, just to
(possibly) provide some insight I've learned by experience.

I currently use java annotations where possible, altough they are a
bit limited, mainly because they don't support inheritance, and cannot
be instantiated.
But annotations stay glued to the Java code, so if it changes, the
annotations adapt (or break visibly).

J.


On Jul 15, 5:40 am, "brett.wooldridge" <brett.wooldri...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages