- You can of course use
@UiField
to let UiBinder instantiate the fields for you duringcreateAndBindUi()
. You can then modify them afterwards. - You can of course use
@UiField(provided=true)
, and instantiate the fields yourself, before callingcreateAndBindUi()
. (This way, you can use any constructor you like, and it also allows for Dependency Injection.) And obviously, you can still modify them aftercreateAndBindUi()
.
So what's the point of @UiFactory
? Well, I use it sometimes, when I have many similar elements in the same ui.xml file. So e. g. I have a page that shows a keypad with digits 0-9. Instead of having ten @UiFields, I prefer to use @UiFactory, which constructs the widgets, and puts them in a java.util.Map (plus performs some common setup).