Search code examples
javagwtxsduibinder

Where is the specification for GWT HTMLPanel UiBinder XML?


I am trying to find what child elements and attributes I can add to:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:gwt="urn:import:com.google.gwt.user.client.ui">
    <gwt:HTMLPanel whatAttribsGoHere="???">
        <!-- ??? -->
    </gwt:HTMLPanel>
</ui:UiBinder>

I found this similar question, however when I go to the recommended link I see no mention of HTMLPanel. Can anyone point me in the right direction? Thanks in advance!

Edit: I'm not looking for any GWT gurus/Google employees to simply tell me what elements/attributes fit here, I'm looking to learn where I can go to find this stuff out on my own! I say this because I could just as easily ask the same question for any other widget!


Solution

  • I've posted an answer on the linked question that explains the general rules. HTMLPanel though might be one of the rare widgets whose usage in UiBinder is not documented, while being the widget that UiBinder empowers the most.

    If you want to learn what specific attributes and content you can put in HTMLPanel (besides bean setter attributes), you can then look at the the code for HTMLPanelParser. You'll see that you can use a tag attribute that matches the similarly named constructor argument, and the content is a mix of HTML and widgets (UiBinder will replace the widgets with placeholder HTML elements in the HTML string passed to the HTMLPanel constructor, and then call addAndReplaceElement to put the child widgets in the panel).