http://gwt-code-reviews.appspot.com/1099801/diff/1/8 File user/src/com/google/gwt/user/client/ui/NumberLabel.java (right):
http://gwt-code-reviews.appspot.com/1099801/diff/1/8#newcode34 user/src/com/google/gwt/user/client/ui/NumberLabel.java:34: } On 2010/11/11 19:06:31, jat wrote:
On 2010/11/11 18:36:23, tbroyer wrote: > Actually, maybe even DateLabel and NumberLabel aren't needed, as in
many cases
> I guess you'll pass a formatter, which means you'll probably use > @UiField(provided=true) or a @UiFactory with UiBinder (which
probably defeats
> the idea of those datatype-specialized widgets) > Or maybe they rather should only have a no-arg ctor, or a
@UiConstructor?
> And/or should the renderer be settable in ValueLabel (which would
allow using
> setters in NumberLabel and DateLabel to easily customize the format
in
> UiBinder without mandating a format, as @UiConstructor would; i.e. > setPredefinedFormat(PredefinedFormat) and setCustomFormat(String) in > DateLabel, and crafting an enum for a similar use in NumberLabel)
I finally went ahead and made the renderer mutable, and added convenient setters in NumberLabel and DateLabel so they're more UiBinder-friendly (see their JavaDoc).
UiBinder can't supply arbitrary values, such as a DateTimeFormat, can
it? Yes, but only if they come from the "Java world"; you cannot express a DateTimeFormat or NumberFormat "in XML". http://gwt-code-reviews.appspot.com/1099801/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
