Restores r10697 now that the CellPanelParser fixes are in place
*** Original change description ***
Change default of UiBinder.useLazyWidgetBuilders to true, in
preparation for deleting the old code.
Also fixes unreported bad code gen for things like <a href="{uh.oh}"> when
safehtml is off. Fix is a bit squirrelly, but
Review at http://gwt-code-reviews.appspot.com/1578803
Review by: rchandia@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10717 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml b/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml
index 749c0c9..21da6fc 100644
--- a/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml
+++ b/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml
@@ -27,11 +27,11 @@
<define-configuration-property name="UiBinder.useSafeHtmlTemplates" is-multi-valued="false"/>
<set-configuration-property name="UiBinder.useSafeHtmlTemplates" value="true"/>
- <!-- UiBinder can be configured to use a new strategy that enables a faster
- rendering mode and make some widgets lazily created. This is still experimental
- but should be the default option in a soon future. -->
+ <!-- Set this property to false to revert to the old code gen strategy,
+ and lose features like support for LazyPanel and forward references. This
+ property will soon disappear. -->
<define-configuration-property name="UiBinder.useLazyWidgetBuilders" is-multi-valued="false"/>
- <set-configuration-property name="UiBinder.useLazyWidgetBuilders" value="false"/>
+ <set-configuration-property name="UiBinder.useLazyWidgetBuilders" value="true"/>
<generate-with class="com.google.gwt.uibinder.rebind.UiBinderGenerator">
<when-type-assignable class="com.google.gwt.uibinder.client.UiRenderer"/>
diff --git a/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java b/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java
index 448cc52..7bda11f 100644
--- a/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java
+++ b/user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java
@@ -52,6 +52,7 @@
private static final String LAZY_WIDGET_BUILDERS_PROPERTY = "UiBinder.useLazyWidgetBuilders";
private static boolean gaveSafeHtmlWarning;
+ private static boolean gaveLazyBuildersWarning;
/**
* Given a UiBinder interface, return the path to its ui.xml file, suitable
@@ -212,7 +213,14 @@
}
private Boolean useLazyWidgetBuilders(MortalLogger logger, PropertyOracle propertyOracle) {
- return extractConfigProperty(logger, propertyOracle, LAZY_WIDGET_BUILDERS_PROPERTY, false);
+ Boolean rtn = extractConfigProperty(logger, propertyOracle, LAZY_WIDGET_BUILDERS_PROPERTY, false);
+ if (!gaveLazyBuildersWarning && !rtn) {
+ logger.warn("Configuration property %s is false. Deprecated code generation is in play. " +
+ "This property will soon become a no-op.",
+ LAZY_WIDGET_BUILDERS_PROPERTY);
+ gaveLazyBuildersWarning = true;
+ }
+ return rtn;
}
private Boolean useSafeHtmlTemplates(MortalLogger logger, PropertyOracle propertyOracle) {
@@ -221,7 +229,8 @@
if (!gaveSafeHtmlWarning && !rtn) {
logger.warn("Configuration property %s is false! UiBinder SafeHtml integration is off, "
- + "leaving your users more vulnerable to cross-site scripting attacks.",
+ + "leaving your users more vulnerable to cross-site scripting attacks. This property " +
+ "will soon become a no-op, and SafeHtml integration will always be on.",
XSS_SAFE_CONFIG_PROPERTY);
gaveSafeHtmlWarning = true;
}
diff --git a/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java b/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java
index 9aba760..63241fa 100644
--- a/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java
+++ b/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java
@@ -1006,7 +1006,7 @@
*/
public String tokenForSafeUriExpression(XMLElement source, String expression) {
if (!useSafeHtmlTemplates) {
- return tokenForStringExpression(source, expression + ".asString()");
+ return tokenForStringExpression(source, expression);
}
htmlTemplates.noteUri(expression);