Custom Tags in UiBinder Files

When using the <g:LayoutPanel> file in the UiBinder.ui.xml files, you can specify the <g:layer> tags. Some other widgets created by Google also have special tags - <g:tab> even has a subtag, <g:header> .

How can I specify them for my own widgets?

+7
gwt uibinder
source share
2 answers

A new answer to this question, after some improvements to the GWT, is at https://stackoverflow.com/a/168389/ . Copied below to avoid deleting the moderator (maybe?).

You can use @UiChild to declare special features in your widgets available in UiBinders.

eg,

 class MyPanel extends AbsolutePanel { @UiChild public void addAt(Widget w, String parameter1, String parameter2) { .... 

Then in your uiBinder you can say

 <custom:MyPanel> <custom:at parameter1="HI" parameter2="Anything you like!"> <g:AnySingleWidget /> </custom:at> </custom:MyPanel> 

See @UiChild at http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/uibinder/client/UiChild.html

+7
source share

What you are looking for is your own element parser for UiBinder. See this question . Unfortunately, it is not yet supported.

You may be interested in this post for some recommendations on how to extend the current parser yourself.

+3
source share

All Articles