Consider the DockLayoutPanel be created in UiBinder like this:
<g:DockLayoutPanel unit='PX' >
<g:west size='100'><g:Label>Start</g:Label></g:west>
<g:east size="100"><g:Label>End</g:Label></g:east>
<g:center><g:Label>Center</g:Label></g:center>
</g:DockLayoutPanel>
When using a locale such as English, start
appears correctly on the left-hand side. When the locale is for a right-to-left (RTL) language, it would be expected for start
to appear on the right-hand side but it doesn't.
In Java code it's possible to use DockLayoutPanel.addLineStart or DockLayoutPanel.addLineEnd instead of DockLayoutPanel.addWest and DockLayoutPanel.addEast, respectively. This places the elements in the appropriate location based on the locale. Is there a way to achieve the same effect with UiBinder?
Note that it's also possible to have an alternative RTL UiBinder template and link that version depending on whether the locale is for right-to-left but I'd prefer to have one template that works for both directions.
It's perfectly possible to use lineStart
and lineEnd
inside a DockLayoutPanel in UiBinder. In essence, UiBinder is able to call these methods the same way it's able to call methods on custom widgets.
So here's the code that should be used in UiBinder:
<g:DockLayoutPanel unit='PX'>
<g:lineStart size='100'><g:Label>Start</g:Label></g:lineStart>
<g:lineEnd size="100"><g:Label>End</g:Label></g:lineEnd>
<g:center><g:Label>Center</g:Label></g:center>
</g:DockLayoutPanel>
Note that as of version 2.6, autocompletion doesn't show lineStart
or lineEnd
when you start typing <g:
. Only g:west
, g:east
, g:north
and g:south
are displayed. However, this doesn't mean other tags may be used. Refer to this GWT issue for more information.