GWT - What's the shortest way of simply sharing strings and number constants between Java code and UiBinder files?
问题 Can someone post an example of the shortest way of sharing a (preferably static final) string or number constant between Java code and UiBinder XML, where I can use the constant either in an attribute: <g:TextArea width="...px"/> or in a value: <g:Label>...</g:Label> I can't seem to find an example of this, only text from a file, which I don't want. 回答1: static fields (and enum constants) can be used with a simple <ui:import> : <ui:import field="com.example.Pojo.CONSTANT" /> or <ui:import