The 3rd patch set adds tests, UiBinder element parsers for DateLabel and
NumberLabel, and the ToggleButton (issue 5571) which I forgot in
previous patches.

I found some issues with generics in UiBinder and had to relax a check
in UiBinderParser (but I believe this is taken care of later on, see the
comment in the code, and comments below).

In case you fear this delays things too much for the 2.1.1 release; it's
possible to split this patch into subparts:
 1. everything except ValueLabel et al. (straightforward)
 2. ValueLabel and the DateLabel and NumberLabel subclasses (without
UiBinder support)
 3. UiBinder parsers for DateLabel and NumberLabel
 4. UiBinder fix for generics (so ValueLabel's @UiConstructor can be
used)


http://gwt-code-reviews.appspot.com/1099801/diff/26001/27006
File user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java
(right):

http://gwt-code-reviews.appspot.com/1099801/diff/26001/27006#newcode267
user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java:267: // Type
matching will be checked by UiBinderWriter#maybeWriteFieldSetter
This was causing errors with ValueLabel's DoubleRenderer in the
UiBinderTest:
resourceType were the JGenericType Renderer<T> whereas ownerField's type
were either a JRawType or JParameterizedType.

There's actually a more subtle issue within BeanParser which prevents
using <ui:with field='doubleRenderer'
type='com.google.gwt.text.client.DoubleRenderer' /> because the
uiField's type for the ValueLabel is ValueLabel<Double> (which accepts a
Renderer<? super Double> argument in its ctor) but the ownerFieldClass
is the JGenericType ValueLabel<T> (expecting a Renderer<? super T>). I
tried changing the ownerFieldClass to uiField.getType() (when uiField is
not null *and* its getType().getRawType() is more specific than the
'type' –otherwise the <gwt:Label gwt:StackPanel-text=.../> fails on the
text="" attribute because the uiField's type is Widget) but it then
fails because the JParameterizedClass renames constructor's argument to
"arg0". Overall, there's some improvements needed around generics.

http://gwt-code-reviews.appspot.com/1099801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to