Reviewers: Ray Ryan,

Message:
Review requested.

Description:
This patch changes how UiBinder's compile-time DOM structure is
generated so that we can provide accurate location information to the
developer when logging errors.  Instead of using a DOM parser, this
patch builds a DOM using a SAX parser that records SaxLocator data in
the new DOM nodes.

The observed behavior of UiBinder's XMLElement type should not change,
save for its toString(), which will include source location information.

The MortalLogger class is updated with warn() and die() messages that
accept an XMLElement.

Example error message by doubling line 8 of Mail.ui.xml:
Compiling module com.google.gwt.sample.mail.Mail
   Scanning for additional dependencies:
file:/Users/bob/gwt/trunk_svn/samples/mail/src/com/google/gwt/sample/mail/client/Mail.java
      Computing all possible rebind results for
'com.google.gwt.sample.mail.client.Mail.Binder'
         Rebinding com.google.gwt.sample.mail.client.Mail.Binder
            Invoking generator
com.google.gwt.uibinder.rebind.UiBinderGenerator
               [ERROR] Element may only contain a single child element,
but found <mail:TopPanel ui:field='topPanel'> at
file:/Users/bob/gwt/trunk_svn/samples/mail/src/com/google/gwt/sample/mail/client/Mail.ui.xml:8
and <mail:TopPanel ui:field='topPanel2'> at
file:/Users/bob/gwt/trunk_svn/samples/mail/src/com/google/gwt/sample/mail/client/Mail.ui.xml:9.
                  [ERROR] See (Mail.ui.xml:7)

Please review this at http://gwt-code-reviews.appspot.com/394801/show

Affected files:
  M user/src/com/google/gwt/uibinder/rebind/MortalLogger.java
  M user/src/com/google/gwt/uibinder/rebind/W3cDomHelper.java
  M user/src/com/google/gwt/uibinder/rebind/XMLAttribute.java
  M user/src/com/google/gwt/uibinder/rebind/XMLElement.java
  M user/test/com/google/gwt/uibinder/rebind/MockMortalLogger.java
  M user/test/com/google/gwt/uibinder/rebind/XMLElementTest.java


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

Reply via email to