Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT UiBinder: How to make a custom AbsolutePanel which uses the "at" element?

Tags:

gwt

uibinder

Trying to extend AbsolutePanel, my UiBinder won't allow the <g:at> element which is normally ok for straight AbsolutePanels. How do I make my AbsolutePanel subclass able to use the <g:at> element? And more generally, can I make custom UiBinder keywords for my own custom Widgets like "at", "west", "layer" etc.?

like image 789
Navigateur Avatar asked Feb 19 '23 16:02

Navigateur


1 Answers

You can use @UiChild to declare special functions in your widgets accessible in UiBinders.

for example,

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

like image 104
Riley Lark Avatar answered May 01 '23 11:05

Riley Lark