[gwt-contrib] Re: Added style getters to UiRenderers (issue1700803)
Great job, and thanks for doing this. Let's go one more round. Also, would you be willing to update the UIBinder docs? :D :D http://gwt-code-reviews.appspot.com/1700803/diff/1/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java File user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java (right): http://gwt-code-reviews.appspot.com/1700803/diff/1/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode1367 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:1367: for (ImplicitCssResource css : bundleClass.getCssMethods()) { Nit: refactor into a helper method (as the code is identical to the three lines below). http://gwt-code-reviews.appspot.com/1700803/diff/1/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode1568 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:1568: * {@code Element}. Update this comment to reflect the new checks that you'd added. http://gwt-code-reviews.appspot.com/1700803/diff/1/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode1576 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:1576: if (field == null || (!FieldWriterType.DEFAULT.equals(field.getFieldType()) Maybe wrap this small block of code into a helper method (for readability)? Also, is there a reason as to why you moved this higher up in the validation order? http://gwt-code-reviews.appspot.com/1700803/diff/1/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode1578 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:1578: die("%s does not match a \"ui:field='%s'\" declaration in %s", getterName, fieldName, This error message does not seem to reflect the fact that there may be a mismatch in the type (as opposed to a failure to find a matching getter name) http://gwt-code-reviews.appspot.com/1700803/diff/1/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode2221 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:2221: // Esle the non-root elements are found by id Spelling (Else). Move this comment within the else block. http://gwt-code-reviews.appspot.com/1700803/diff/1/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode2225 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:2225: // return (ElementSubclass) findUiField(parent); Seems like this comment is inaccurate. http://gwt-code-reviews.appspot.com/1700803/diff/1/user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java#newcode2230 user/src/com/google/gwt/uibinder/rebind/UiBinderWriter.java:2230: // return (ElementSubclass) findPreviouslyRendered(parent); Seems like this comment is inaccurate. http://gwt-code-reviews.appspot.com/1700803/diff/1/user/test/com/google/gwt/uibinder/rebind/AbstractUiBinderWriterTest.java File user/test/com/google/gwt/uibinder/rebind/AbstractUiBinderWriterTest.java (right): http://gwt-code-reviews.appspot.com/1700803/diff/1/user/test/com/google/gwt/uibinder/rebind/AbstractUiBinderWriterTest.java#newcode105 user/test/com/google/gwt/uibinder/rebind/AbstractUiBinderWriterTest.java:105: public static final MockJavaResource UI_STYLE = new MockJavaResource("foo.UiStyle") { Good man (adding test code). I like your style. http://www.anyclip.com/movies/starsky-hutch/biker-bar-fight/ (start watching at 1:20) http://gwt-code-reviews.appspot.com/1700803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix initialization of non-final fields (issue1618807)
Ping (ray). http://gwt-code-reviews.appspot.com/1618807/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix issue 6710: entities referenced from list of value proxies (issue1646803)
https://gwt-code-reviews.appspot.com/1646803/diff/1/user/src/com/google/web/bindery/requestfactory/server/Resolver.java File user/src/com/google/web/bindery/requestfactory/server/Resolver.java (right): https://gwt-code-reviews.appspot.com/1646803/diff/1/user/src/com/google/web/bindery/requestfactory/server/Resolver.java#newcode365 user/src/com/google/web/bindery/requestfactory/server/Resolver.java:365: new IdentityHashMap(); On 2012/04/10 08:05:33, tbroyer wrote: On 2012/04/09 15:44:43, rdayal wrote: > Looks good, but I must say that I dont' quite understand how/why this fixes the > problem. Can you point out how the code execution in this class would have > resulted in a breakage with a HashMap vs. an IdentityHashMap? At line 632, a collection is populated with the result of resolveClientValue(Object,Type), which is always an empty proxy (properties are populated later) –modulo reuse of a proxy if it has already been resolved–. This isn't an issue with EntityProxies, as each proxy as at a minimum a stableId that keys it to a domain object and distinguishes it from other proxies (for other domain objects), but ValueProxies compare equals() to each other by their properties' values only, independently of the underlying domain object. So, when you resolve a collection of ValueProxies, the first iteration of the loop (at line 632) creates a new, empty ValueProxy and puts it in the clientObjectsToResolutions map. Sorry for the long delay on this, but doing a bit of thinking - it seems incorrect to add an empty ValueProxy object to the clientObjectToResolutionMap when there's no representation of it. It seems that items should be added to this list when they're actually resolved (i.e filled in; not empty). Can we come up with a solution that satisfies this? It may require the addition of another "unresolved" List, and then migration over to the map when items are filled in. Though it's going to add more code, I think the workaround we have here is a bit of a hack. I think it's an elegant hack, but it just feels wrong to be working around ValueProxy.equals() because we're trying to add empty value proxies to a "resolved" map when they really haven't been totally resolved yet. Thoughts? In the second iteration, resolveClientValue will create another ValueProxy, but will return the same Resolution because the ValueProxy compares equals() to the previous one, so getting the Resolution from the map will return the one for the first ValueProxy. Using an IdentityHashMap fixes that lookup, so that we have one Resolution instance per proxy instance. Because we have other guards for EntityProxies (keyed by stableId in state.getBeansForPayload(), via resolveClientProxy), that change is safe: the goal is to have a most one proxy per domain object (which is guaranteed in RequestState for EntityProxies) https://gwt-code-reviews.appspot.com/1646803/diff/1/user/test/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryTest.java File user/test/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryTest.java (right): https://gwt-code-reviews.appspot.com/1646803/diff/1/user/test/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryTest.java#newcode587 user/test/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryTest.java:587: simpleFooRequest().returnValueProxies().with("simpleFoo.fooField").fire(new Receiver>() { On 2012/04/27 15:01:36, tbroyer wrote: On 2012/04/27 14:40:24, rdayal wrote: > On 2012/04/10 08:05:33, tbroyer wrote: > > On 2012/04/09 15:44:43, rdayal wrote: > > > Sorry if this is naive question, but since the returnValueProxies method > > > implementation always fills in all of the properties (such as fooField), > > doesn't > > > the with("simpleFoo.fooField") become redundant? Based on the implementation > > of > > > returnValueProxies(), it seems that simpleFoo.fooField will always be filled > > in, > > > regardless of whether or not you use the 'with' statement. > > > > The with() is not passed down to the domain method (which is another issue: > > > https://wave.google.com/wave/waveref/googlewave.com/w+WU4iAICkI/%25257E/conv+root/b+QDorc1lYB > > ), it's a wire-protocol thing (it's not even sent to the server when using the > > JsonRpc dialect). > > By default, for EntityProxies, only "value-type" properties are populated > (those > > that can be encoded by ValueCodex; and lists of those). If you want any other > > kind of object to be serialized and sent to the client, it has to be asked for > > explicitly using with(); independently of whether the domain method will > > populate the property on the server-side. > > AH!!! I did not know that. Thanks again. BTW, I can't read that wave - can you > add me to it? Unfortunately, Wave is readonly so I cannot add you to the wave, so I exported it and mailed it to you. BTW, with() is documented in https://developers.google.com/web-toolkit/doc/latest
[gwt-contrib] Filter no longer referenced symbols from symbol table. (issue1711804)
Reviewers: cromwellian, Description: Filter no longer referenced symbols from symbol table. Please review this at http://gwt-code-reviews.appspot.com/1711804/ Affected files: M dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java A dev/core/src/com/google/gwt/dev/jjs/impl/VerifySymbolMap.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: DefaultProxyStore violated ProxyStore#nextId contract. (issue1622803)
Passes the internal set of tests now. Yay! Skybrian's going to do the internal review. http://gwt-code-reviews.appspot.com/1622803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add StyleInjector.flush (issue1614806)
Ping. http://gwt-code-reviews.appspot.com/1614806/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: DefaultProxyStore violated ProxyStore#nextId contract. (issue1622803)
LGTM. Going to run this back through the battery of tests. http://gwt-code-reviews.appspot.com/1622803/diff/6001/user/test/com/google/web/bindery/requestfactory/server/SimpleFoo.java File user/test/com/google/web/bindery/requestfactory/server/SimpleFoo.java (left): http://gwt-code-reviews.appspot.com/1622803/diff/6001/user/test/com/google/web/bindery/requestfactory/server/SimpleFoo.java#oldcode858 user/test/com/google/web/bindery/requestfactory/server/SimpleFoo.java:858: public void setSimpleValues(List simpleValueField) { How odd and confusing that the setter would just set the first entryI know it's just for testing code, but it makes it tricky for other people to use SimpleFoo for their unit testing.. Anyway, good catch. http://gwt-code-reviews.appspot.com/1622803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Fix for issue 5952: RequestContext#isChanged. (issue1601806)
Just a minor nit; otherwise LGTM. http://gwt-code-reviews.appspot.com/1601806/diff/40003/user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java File user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java (right): http://gwt-code-reviews.appspot.com/1601806/diff/40003/user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java#newcode706 user/src/com/google/web/bindery/requestfactory/shared/impl/AbstractRequestContext.java:706: boolean isDiffing() { Nit: package protected methods need to appear after protected methods. http://gwt-code-reviews.appspot.com/1601806/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add white-space support to Style (issue1714803)
http://gwt-code-reviews.appspot.com/1714803/diff/1/user/src/com/google/gwt/user/client/ui/Anchor.java File user/src/com/google/gwt/user/client/ui/Anchor.java (right): http://gwt-code-reviews.appspot.com/1714803/diff/1/user/src/com/google/gwt/user/client/ui/Anchor.java#newcode87 user/src/com/google/gwt/user/client/ui/Anchor.java:87: public static class Target //TODO added this class Sorry must have forgotten to remove this, it was not supposed to be in there. I'll fix it when I get home. http://gwt-code-reviews.appspot.com/1714803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Removing uses of deprecated Tree code in GWT showcase sample and TreeExample. (issue1712804)
http://gwt-code-reviews.appspot.com/1712804/diff/1/samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java File samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java (right): http://gwt-code-reviews.appspot.com/1712804/diff/1/samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java#newcode179 samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java:179: itemHtml.appendEscaped(" ").appendEscaped(label); Good call. I'll fix it before submitting. http://gwt-code-reviews.appspot.com/1712804/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Removing uses of deprecated Tree code in GWT showcase sample and TreeExample. (issue1712804)
http://gwt-code-reviews.appspot.com/1712804/diff/1/samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java File samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java (right): http://gwt-code-reviews.appspot.com/1712804/diff/1/samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java#newcode179 samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java:179: itemHtml.appendEscaped(" ").appendEscaped(label); Should we really escape a single space? Couldn't we use appendHtmlConstant here? http://gwt-code-reviews.appspot.com/1712804/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add white-space support to Style (issue1714803)
Many more widgets implement HasWordWrap than just Anchor and CheckBox: http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/HasWordWrap.html You might also want to update SafeStyleBuilder and SafeStyleUtils to add similar methods. http://gwt-code-reviews.appspot.com/1714803/diff/1/user/src/com/google/gwt/user/client/ui/Anchor.java File user/src/com/google/gwt/user/client/ui/Anchor.java (right): http://gwt-code-reviews.appspot.com/1714803/diff/1/user/src/com/google/gwt/user/client/ui/Anchor.java#newcode87 user/src/com/google/gwt/user/client/ui/Anchor.java:87: public static class Target //TODO added this class Does not seem related to the proposed change. http://gwt-code-reviews.appspot.com/1714803/diff/1/user/src/com/google/gwt/user/client/ui/Anchor.java#newcode455 user/src/com/google/gwt/user/client/ui/Anchor.java:455: return !"nowrap".equals(getElement().getStyle().getWhiteSpace()); Use the WhiteSpace.NOWRAP enum instead of the hard-coded "nowrap"? (using getCssName() to get it as string) http://gwt-code-reviews.appspot.com/1714803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Removing uses of deprecated Tree code in GWT showcase sample and TreeExample. (issue1712804)
Reviewers: skybrian, Description: Removing uses of deprecated Tree code in GWT showcase sample and TreeExample. Please review this at http://gwt-code-reviews.appspot.com/1712804/ Affected files: M samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackLayoutPanel.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java M samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwTree.java M user/javadoc/com/google/gwt/examples/TreeExample.java Index: samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackLayoutPanel.java === --- samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackLayoutPanel.java (revision 10982) +++ samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackLayoutPanel.java (working copy) @@ -105,6 +105,7 @@ /** * Use noimage.png, which is a blank 1x1 image. */ +@Override @Source("noimage.png") ImageResource treeLeaf(); } @@ -163,10 +164,12 @@ protected void asyncOnInitialize(final AsyncCallback callback) { GWT.runAsync(CwStackLayoutPanel.class, new RunAsyncCallback() { + @Override public void onFailure(Throwable caught) { callback.onFailure(caught); } + @Override public void onSuccess() { callback.onSuccess(onInitialize()); } @@ -219,6 +222,7 @@ // Open the contact info popup when the user clicks a contact contactLink.addClickHandler(new ClickHandler() { +@Override public void onClick(ClickEvent event) { // Set the info about the contact SafeHtmlBuilder sb = new SafeHtmlBuilder(); @@ -285,7 +289,7 @@ @ShowcaseSource private Widget createMailItem(Images images) { Tree mailPanel = new Tree(images); -TreeItem mailPanelRoot = mailPanel.addItem("f...@example.com"); +TreeItem mailPanelRoot = mailPanel.addTextItem("f...@example.com"); String[] mailFolders = constants.cwStackLayoutPanelMailFolders(); addItem(mailPanelRoot, images.inbox(), mailFolders[0]); addItem(mailPanelRoot, images.drafts(), mailFolders[1]); Index: samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java === --- samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java (revision 10982) +++ samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwStackPanel.java (working copy) @@ -21,6 +21,7 @@ import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.i18n.client.Constants; import com.google.gwt.resources.client.ImageResource; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; import com.google.gwt.sample.showcase.client.ContentWidget; import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseData; import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseSource; @@ -101,6 +102,7 @@ /** * Use noimage.png, which is a blank 1x1 image. */ +@Override @Source("noimage.png") ImageResource treeLeaf(); } @@ -159,10 +161,12 @@ protected void asyncOnInitialize(final AsyncCallback callback) { GWT.runAsync(CwStackPanel.class, new RunAsyncCallback() { + @Override public void onFailure(Throwable caught) { callback.onFailure(caught); } + @Override public void onSuccess() { callback.onSuccess(onInitialize()); } @@ -170,7 +174,10 @@ } private void addItem(TreeItem root, ImageResource image, String label) { -root.addItem(AbstractImagePrototype.create(image).getHTML() + " " + label); +SafeHtmlBuilder itemHtml = new SafeHtmlBuilder(); +itemHtml.append(AbstractImagePrototype.create(image).getSafeHtml()); +itemHtml.appendEscaped(" ").appendEscaped(label); +root.addItem(itemHtml.toSafeHtml()); } /** @@ -203,6 +210,7 @@ // Open the contact info popup when the user clicks a contact contactLink.addClickHandler(new ClickHandler() { +@Override public void onClick(ClickEvent event) { // Set the info about the contact contactInfo.setHTML(contactName + "" + contactEmail + ""); @@ -242,7 +250,7 @@ @ShowcaseSource private Tree createMailItem(Images images) { Tree mailPanel = new Tree(images); -TreeItem mailPanelRoot = mailPanel.addItem("f...@example.com"); +TreeItem mailPanelRoot = mailPanel.addTextItem("f...@example.com"); String[] mailFolders = constants.cwStackPanelMailFolders(); addItem(mailPanelRoot, images.inbox(), mailFolders[0]); addItem(mailPanelRoot, images.drafts(), mailFolders[1]); Index: samples/showcase/src/com/google/gwt/sample/showcase/client/content/lists/CwTree.j
[gwt-contrib] Add white-space support to Style (issue1714803)
Reviewers: , Please review this at http://gwt-code-reviews.appspot.com/1714803/ Affected files: user/src/com/google/gwt/dom/client/Style.java user/src/com/google/gwt/user/client/ui/Anchor.java user/src/com/google/gwt/user/client/ui/CheckBox.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Revert "GWT support for Chrome Frame" (issue1713803)
Reviewers: cromwellian, Description: Revert "GWT support for Chrome Frame" This reverts commit r10250. Fixes issue 6665. Please review this at http://gwt-code-reviews.appspot.com/1713803/ Affected files: M user/src/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java Index: user/src/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java diff --git a/user/src/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java b/user/src/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java index 0a44fd5fce85cee142ddec71131b503e256c3f37..742c7f79b5d3928aa019ffcfa7dd4c40bddd8d6c 100644 --- a/user/src/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java +++ b/user/src/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java @@ -57,28 +57,10 @@ public class UserAgentPropertyGenerator implements PropertyProviderGenerator { .println("return (ua.indexOf('opera') != -1);") .returns("'opera'"), - // webkit family (chrome, safari and chromeframe). + // webkit family new UserAgentPropertyGeneratorPredicate("safari") .getPredicateBlock() -.println("return (") - .println("(ua.indexOf('webkit') != -1)") - .println("||") - .println("(function() {") -.println("if (ua.indexOf('chromeframe') != -1) {") - .println("return true;") -.println("}") -.println("if (typeof window['ActiveXObject'] != 'undefined') {") - .println("try {") -.println("var obj = new ActiveXObject('ChromeTab.ChromeFrame');") -.println("if (obj) {") - .println("obj.registerBhoIfNeeded();") - .println("return true;") -.println("}") - .println("} catch(e) { }") -.println("}") -.println("return false;") -.println("})()") -.println(")") +.println("return (ua.indexOf('webkit') != -1);") .returns("'safari'"), // IE9 -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
[gwt-contrib] Re: Add Integer.TYPE, etc. (issue1528806)
http://gwt-code-reviews.appspot.com/1528806/diff/8001/user/super/com/google/gwt/emul/java/lang/Double.java File user/super/com/google/gwt/emul/java/lang/Double.java (right): http://gwt-code-reviews.appspot.com/1528806/diff/8001/user/super/com/google/gwt/emul/java/lang/Double.java#newcode36 user/super/com/google/gwt/emul/java/lang/Double.java:36: // 2^512, 2^-512 On 2012/05/21 21:04:46, stephenh wrote: Er...these changes aren't in the raw patchset/diff file that I uploaded. I must have confused reitveld by rebasing my latest patchset against trunk. Yes, Rietveld basically compares the files after being patched, not the diffs (that'd be overly complicated I guess); so comparing two patch-sets where one has been rebased will also show the changes between the revisions the patches were based on. Notice how this doesn't happen when comparing patch-set #3 with the "base"? That doesn't mean you shouldn't rebase, just that you should probably tell reviewers when rebasing, and be careful when reviewing (switch between comparing with the "base" and comparing with the previous patch-set; or simply not use the "compare to previous patch-set" when you know the change has been rebased). BTW, you'll find the exact same behaviors in Gerrit or ReviewBoard. http://gwt-code-reviews.appspot.com/1528806/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors