Description:
Introduces UiBinder
http://code.google.com/p/google-web-toolkit-incubator/wiki/UiBinder
The actual source code has been through thorough code review over the
last year+ of use in various Google projects, including the new AdWords
UI and Wave. Feedback and criticism is of course solicited, but I'm
planning to submit this patch unmodified to serve as a base line.
The exception to the above is the eclipse .classpath. Does that look
right?
Please review this at http://gwt-code-reviews.appspot.com/51831
Affected files:
eclipse/user/.classpath
user/src/com/google/gwt/uibinder/UiBinder.gwt.xml
user/src/com/google/gwt/uibinder/client/AbstractUiBinder.java
user/src/com/google/gwt/uibinder/client/DomHolder.java
user/src/com/google/gwt/uibinder/client/UiBinder.java
user/src/com/google/gwt/uibinder/client/UiBinderUtil.java
user/src/com/google/gwt/uibinder/client/UiConstructor.java
user/src/com/google/gwt/uibinder/client/UiFactory.java
user/src/com/google/gwt/uibinder/client/UiField.java
user/src/com/google/gwt/uibinder/client/UiHandler.java
user/src/com/google/gwt/uibinder/client/UiTemplate.java
user/src/com/google/gwt/uibinder/parsers/AttributeMessageInterpreter.java
user/src/com/google/gwt/uibinder/parsers/AttributeMessageParser.java
user/src/com/google/gwt/uibinder/parsers/AttributeParser.java
user/src/com/google/gwt/uibinder/parsers/BeanParser.java
user/src/com/google/gwt/uibinder/parsers/BooleanAttributeParser.java
user/src/com/google/gwt/uibinder/parsers/BundleAttributeParser.java
user/src/com/google/gwt/uibinder/parsers/CellPanelParser.java
user/src/com/google/gwt/uibinder/parsers/ComputedAttributeInterpreter.java
user/src/com/google/gwt/uibinder/parsers/CustomButtonParser.java
user/src/com/google/gwt/uibinder/parsers/DisclosurePanelParser.java
user/src/com/google/gwt/uibinder/parsers/DockPanelParser.java
user/src/com/google/gwt/uibinder/parsers/DomElementParser.java
user/src/com/google/gwt/uibinder/parsers/ElementParser.java
user/src/com/google/gwt/uibinder/parsers/FieldInterpreter.java
user/src/com/google/gwt/uibinder/parsers/HTMLPanelParser.java
user/src/com/google/gwt/uibinder/parsers/HasHTMLParser.java
user/src/com/google/gwt/uibinder/parsers/HasTextParser.java
user/src/com/google/gwt/uibinder/parsers/HasWidgetsParser.java
user/src/com/google/gwt/uibinder/parsers/HorizontalAlignmentConstantParser.java
user/src/com/google/gwt/uibinder/parsers/HtmlInterpreter.java
user/src/com/google/gwt/uibinder/parsers/HtmlMessageInterpreter.java
user/src/com/google/gwt/uibinder/parsers/HtmlPlaceholderInterpreter.java
user/src/com/google/gwt/uibinder/parsers/IntPairParser.java
user/src/com/google/gwt/uibinder/parsers/IntParser.java
user/src/com/google/gwt/uibinder/parsers/InterpreterPipe.java
user/src/com/google/gwt/uibinder/parsers/MenuBarParser.java
user/src/com/google/gwt/uibinder/parsers/MenuItemParser.java
user/src/com/google/gwt/uibinder/parsers/NullInterpreter.java
user/src/com/google/gwt/uibinder/parsers/RadioButtonParser.java
user/src/com/google/gwt/uibinder/parsers/StackPanelParser.java
user/src/com/google/gwt/uibinder/parsers/StringAttributeParser.java
user/src/com/google/gwt/uibinder/parsers/TabPanelParser.java
user/src/com/google/gwt/uibinder/parsers/TextInterpreter.java
user/src/com/google/gwt/uibinder/parsers/TextPlaceholderInterpreter.java
user/src/com/google/gwt/uibinder/parsers/UIObjectParser.java
user/src/com/google/gwt/uibinder/parsers/VerticalAlignmentConstantParser.java
user/src/com/google/gwt/uibinder/parsers/WidgetInterpreter.java
user/src/com/google/gwt/uibinder/parsers/WidgetPlaceholderInterpreter.java
user/src/com/google/gwt/uibinder/rebind/ChildWalker.java
user/src/com/google/gwt/uibinder/rebind/FieldManager.java
user/src/com/google/gwt/uibinder/rebind/FieldWriter.java
user/src/com/google/gwt/uibinder/rebind/GetInnerHtmlVisitor.java
user/src/com/google/gwt/uibinder/rebind/GetInnerTextVisitor.java
user/src/com/google/gwt/uibinder/rebind/GwtResourceEntityResolver.java
user/src/com/google/gwt/uibinder/rebind/HandlerEvaluator.java
user/src/com/google/gwt/uibinder/rebind/IndentedWriter.java
user/src/com/google/gwt/uibinder/rebind/NodeVisitor.java
user/src/com/google/gwt/uibinder/rebind/Tokenator.java
user/src/com/google/gwt/uibinder/rebind/UiBinderGenerator.java
user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java
user/src/com/google/gwt/uibinder/rebind/XMLAttribute.java
user/src/com/google/gwt/uibinder/rebind/XMLElement.java
user/src/com/google/gwt/uibinder/rebind/messages/AttributeMessage.java
user/src/com/google/gwt/uibinder/rebind/messages/GenerateAnnotationWriter.java
user/src/com/google/gwt/uibinder/rebind/messages/MessageWriter.java
user/src/com/google/gwt/uibinder/rebind/messages/MessagesWriter.java
user/src/com/google/gwt/uibinder/rebind/messages/PlaceholderInterpreter.java
user/src/com/google/gwt/uibinder/rebind/messages/PlaceholderWriter.java
user/src/com/google/gwt/uibinder/rebind/model/OwnerClass.java
user/src/com/google/gwt/uibinder/rebind/model/OwnerField.java
user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java
user/src/com/google/gwt/uibinder/resources/xhtml.ent
user/src/com/google/gwt/uibinder/sample/UiBinderDemo.gwt.xml
user/src/com/google/gwt/uibinder/sample/client/AnnotatedStrictLabel.java
user/src/com/google/gwt/uibinder/sample/client/ClickyLink.java
user/src/com/google/gwt/uibinder/sample/client/DomBasedUi.css
user/src/com/google/gwt/uibinder/sample/client/DomBasedUi.java
user/src/com/google/gwt/uibinder/sample/client/DomBasedUi.ui.xml
user/src/com/google/gwt/uibinder/sample/client/ExplicitElementPanel.java
user/src/com/google/gwt/uibinder/sample/client/ExplicitElementWidget.java
user/src/com/google/gwt/uibinder/sample/client/FakeBundle.java
user/src/com/google/gwt/uibinder/sample/client/Foo.java
user/src/com/google/gwt/uibinder/sample/client/FooLabel.java
user/src/com/google/gwt/uibinder/sample/client/HandlerDemo.java
user/src/com/google/gwt/uibinder/sample/client/HandlerDemo.ui.xml
user/src/com/google/gwt/uibinder/sample/client/MyDatePicker.java
user/src/com/google/gwt/uibinder/sample/client/MyEntities.ent
user/src/com/google/gwt/uibinder/sample/client/NeedlesslyAnnotatedLabel.java
user/src/com/google/gwt/uibinder/sample/client/PointlessRadioButtonSubclass.java
user/src/com/google/gwt/uibinder/sample/client/StrictLabel.java
user/src/com/google/gwt/uibinder/sample/client/UiBinderDemo.java
user/src/com/google/gwt/uibinder/sample/client/WidgetBasedUi.css
user/src/com/google/gwt/uibinder/sample/client/WidgetBasedUi.java
user/src/com/google/gwt/uibinder/sample/client/WidgetBasedUi.ui.xml
user/src/com/google/gwt/uibinder/sample/client/WidgetBasedUiResources.java
user/src/com/google/gwt/uibinder/sample/public/UiBinderDemo.html
user/src/com/google/gwt/uibinder/testing/BUILD
user/src/com/google/gwt/uibinder/testing/UiBinderTesting.java
user/test/com/google/gwt/uibinder/JClassTypeAdapter.java
user/test/com/google/gwt/uibinder/UiBinderGwtSuite.java
user/test/com/google/gwt/uibinder/UiBinderSmallSuite.java
user/test/com/google/gwt/uibinder/UiBinderTestModule.gwt.xml
user/test/com/google/gwt/uibinder/client/UiBinderTest.java
user/test/com/google/gwt/uibinder/rebind/GwtResourceEntityResolverTest.java
user/test/com/google/gwt/uibinder/rebind/HandlerEvaluatorTest.java
user/test/com/google/gwt/uibinder/rebind/TokenatorTest.java
user/test/com/google/gwt/uibinder/rebind/XMLElementTest.java
user/test/com/google/gwt/uibinder/rebind/model/OwnerClassTest.java
user/test/com/google/gwt/uibinder/rebind/model/OwnerFieldClassTest.java
user/test/com/google/gwt/uibinder/rebind/model/OwnerFieldTest.java
A question for the group: the stuff under rebind and parsers should not
be considered public API, it's just not ready for that. Is javadoc to
that effect enough of a deterrent? (Although I suppose the fact that you
can't actually make your own parsers and such *do* anything yet will
make the issue moot.)
> A question for the group: the stuff under rebind and parsers should
not be
> considered public API, it's just not ready for that. Is javadoc to
that effect
> enough of a deterrent? (Although I suppose the fact that you can't
actually make
> your own parsers and such *do* anything yet will make the issue moot.)
I would assume that if you can't usefully write your own yet, then it's
pretty safe to keep evolving the API. I assume that there's a
2.0-time-frame task to make a public API for parsers?
I also assume that at some point we'll need to move the sample code out
into a proper sample, and that we'll want to come back and change our
existing samples to use UiBinder as well.
http://gwt-code-reviews.appspot.com/51831/diff/1/2
File eclipse/user/.classpath (right):
http://gwt-code-reviews.appspot.com/51831/diff/1/2#newcode19
Line 19: <classpathentry kind="var"
path="GWT_TOOLS/lib/easymock/easymockclassextension.jar"
sourcepath="/GWT_TOOLS/lib/easymock/easymockclassextension-src.zip"/>
I'll assume that all these libraries are necessary, and that you've
checked up on the licenses and made sure they're in the /tools repo.
http://gwt-code-reviews.appspot.com/51831/diff/1/6
File user/src/com/google/gwt/uibinder/client/UiBinder.java (right):
http://gwt-code-reviews.appspot.com/51831/diff/1/6#newcode36
Line 36:
There was talk at one point of re-unifying these methods. If that's
still in the cards, should we make a note to that effect as a warning?
http://gwt-code-reviews.appspot.com/51831/diff/1/17
File
user/src/com/google/gwt/uibinder/parsers/BooleanAttributeParser.java
(right):
http://gwt-code-reviews.appspot.com/51831/diff/1/17#newcode26
Line 26: // TODO(jgw): check validity.
Hey, that looks like my mistake :)
I share your concern, Amir, but I'm even more afraid of a) providing an ill considered API for custom parsers and b) delaying 2.0. I'm pretty confident we can limp along without them for a dot release.
http://gwt-code-reviews.appspot.com/51831/diff/1/2#newcode19
Line 19: <classpathentry kind="var"
path="GWT_TOOLS/lib/easymock/easymockclassextension.jar"
sourcepath="/GWT_TOOLS/lib/easymock/easymockclassextension-src.zip"/>
On 2009/08/04 19:32:59, jgw wrote:
> I'll assume that all these libraries are necessary, and that you've
checked up
> on the licenses and made sure they're in the /tools repo.
Yes, and done. Hope the gratuitous sort was okay, this joint was a mess.
http://gwt-code-reviews.appspot.com/51831/diff/1/6
File user/src/com/google/gwt/uibinder/client/UiBinder.java (right):
http://gwt-code-reviews.appspot.com/51831/diff/1/6#newcode36
Line 36:
On 2009/08/04 19:32:59, jgw wrote:
> There was talk at one point of re-unifying these methods. If that's
still in the
> cards, should we make a note to that effect as a warning?
Oops! Right, thanks. Deprecating them for this patch, will follow up.
http://gwt-code-reviews.appspot.com/51831/diff/1017/1019
File tools/api-checker/config/gwt16_20userApi.conf (right):
http://gwt-code-reviews.appspot.com/51831/diff/1017/1019#newcode82
Line 82: :com.google.gwt.uibinder.parsers\
Changes to this file looks good to me.
http://gwt-code-reviews.appspot.com/51831/diff/1017/1019#newcode68
Line 68:
:user/src/com/google/gwt/user/client/rpc/core/java/util/LinkedHashMap_CustomFieldSerializer.java\
add
:user/src/com/google/gwt/uibinder/parsers\
http://gwt-code-reviews.appspot.com/51831/diff/1017/1019#newcode82
Line 82: :com.google.gwt.uibinder.parsers\
On 2009/08/04 21:43:58, amitmanjhi wrote:
> Changes to this file looks good to me.
My bad. I did not look at enough context. Remove these two lines from
here and make the change above.