I would like to do absolute layout using said panel by only using ui.xml file however it isn't clear if this is possible since the documentation concentrates on the code and ignores the layout language altogether. I'm assuming, since the tutorial doesn't mention this, it is impossible but would like to know for sure.
You are right - there's no way to do this at the moment. This could be addressed in a future GWT release by introducing some custom syntax, like it was done for DockLayoutPanel
. But I doubt it - you'd want to write code like this:
<g:AbsolutePanel ui:field="absolutePanel">
<g:Button x="50px" y="50px">Test</g:Button>
</g:AbsolutePanel>
However this conflicts with the "bean" (as in Java Beans; if you have a getSomethingCool
method, you can write somethingCool="kewl"
in the UiBinder code and it will autmagically call the appropriate get/set method) style - because Button
doesn't have a setX/Y
method. This could be bypassed by replacing the setX/Y
calls with appropriate calls to existing methods (CSS positioning, etc) at compile time. But this introduces yet another custom behavior, dependent on the wrapping Widget/Panel - I think the GWT devs would like to avoid that.