If I have the following class com.mywebapp.client.ui.MyWidget
:
public class MyWidget extends Composite {
interface MyWidgetUiBinder extends UiBinder<Widget, MyWidget>{}
private static MyWidgetUiBinder uiBinder = GWT.create(MyWidgetUiBinder.class);
...
}
And it's corresponding UiBinder:
<!-- MyWidgetUiBinder.ui.xml -->
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui'>
<!-- ... -->
</ui:UiBinder>
Then:
MyWidgetUiBinder.ui.xml
go? Does GWT allow you to make this configurable or does it require that you place it somewhere specifically?Thanks in advance!
UiBinder looks for a file named after the enclosing class of the interface (if any, otherwise the interface name), in the same package as that class.
In your case, it'll look for a com/mywebapp/client/ui/MyWidget.ui.xml
.
This is the default, and can be overridden using @UiTemplate
. See https://developers.google.com/web-toolkit/doc/latest/DevGuideUiBinder#Apply_different_xml
As for the granularity, UiBinder templates should be kept an implementation detail of a widget.