Reviewers: rjrjr, rchandia,
Description:
Add compile-time check to prevent provided fields for HTMLPanels.
Please review this at http://gwt-code-reviews.appspot.com/1459801/
Affected files:
M user/src/com/google/gwt/uibinder/elementparsers/HTMLPanelParser.java
Index: user/src/com/google/gwt/uibinder/elementparsers/HTMLPanelParser.java
===================================================================
--- user/src/com/google/gwt/uibinder/elementparsers/HTMLPanelParser.java
(revision 7614)
+++ user/src/com/google/gwt/uibinder/elementparsers/HTMLPanelParser.java
(working copy)
@@ -22,6 +22,7 @@
import com.google.gwt.uibinder.rebind.XMLElement;
import com.google.gwt.uibinder.rebind.messages.MessageWriter;
import com.google.gwt.uibinder.rebind.messages.PlaceholderInterpreter;
+import com.google.gwt.uibinder.rebind.model.OwnerField;
/**
* Parses {@link com.google.gwt.user.client.ui.HTMLPanel} widgets.
@@ -30,6 +31,13 @@
public void parse(XMLElement elem, String fieldName, JClassType type,
final UiBinderWriter writer) throws UnableToCompleteException {
+
+ // Make sure that, if there is a UiField for this panel, it isn't
+ // (provided = true), as that isn't supported.
+ OwnerField uiField = writer.getOwnerClass().getUiField(fieldName);
+ if (uiField != null && uiField.isProvided()) {
+ writer.die("UiField %s for HTMLPanel cannot be provided.",
fieldName);
+ }
/*
* Gathers up elements that indicate nested widgets (but only those
that are
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors