Change <ui:style source='...'/> to <ui:style src='...'/> for consistency w/HTML
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6188 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java b/user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java
index 55565b9..fd00756 100644
--- a/user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java
+++ b/user/src/com/google/gwt/uibinder/rebind/UiBinderParser.java
@@ -31,6 +31,9 @@
* document.
*/
public class UiBinderParser {
+ private static final String FIELD_ATTRIBUTE = "field";
+ private static final String SOURCE_ATTRIBUTE = "src";
+
// TODO(rjrjr) Make all the ElementParsers receive their dependencies via
// constructor like this one does, and make this an ElementParser. I want
// guice!!!
@@ -103,7 +106,7 @@
* Interprets <ui:with> elements.
*/
private void createResource(XMLElement elem) throws UnableToCompleteException {
- String resourceName = elem.consumeRequiredAttribute("field");
+ String resourceName = elem.consumeRequiredAttribute(FIELD_ATTRIBUTE);
JClassType resourceType = consumeTypeAttribute(elem);
if (elem.getAttributeCount() > 0) {
writer.die("In %s, should only find attributes \"field\" and \"type\"", elem);
@@ -143,12 +146,12 @@
private void createStyle(XMLElement elem) throws UnableToCompleteException {
String body = elem.consumeInnerText(new NullInterpreter<String>());
- if (body.length() > 0 && elem.hasAttribute("source")) {
+ if (body.length() > 0 && elem.hasAttribute(SOURCE_ATTRIBUTE)) {
writer.die("In %s, cannot use both a source attribute and inline css text.", elem);
}
- String source = elem.consumeAttribute("source");
- String name = elem.consumeAttribute("field", "style");
+ String source = elem.consumeAttribute(SOURCE_ATTRIBUTE);
+ String name = elem.consumeAttribute(FIELD_ATTRIBUTE, "style");
JClassType publicType = consumeCssResourceType(elem);
ImplicitCssResource cssMethod = bundleClass.createCssResource(name, source,
diff --git a/user/src/com/google/gwt/uibinder/sample/client/WidgetBasedUi.ui.xml b/user/src/com/google/gwt/uibinder/sample/client/WidgetBasedUi.ui.xml
index 33ba429..d16bb54 100644
--- a/user/src/com/google/gwt/uibinder/sample/client/WidgetBasedUi.ui.xml
+++ b/user/src/com/google/gwt/uibinder/sample/client/WidgetBasedUi.ui.xml
@@ -69,7 +69,7 @@
<!--
Tests creating a CssResource from an external file.
-->
-<ui:style field='myStyle' source='WidgetBasedUi.css'
+<ui:style field='myStyle' src='WidgetBasedUi.css'
type='com.google.gwt.uibinder.sample.client.WidgetBasedUi.Style'/>
<ui:style field='myOtherStyle' type='com.google.gwt.uibinder.sample.client.WidgetBasedUi.Style'>